The game often recalculates morale effects, so transfering buildings shouldn't be too much of an issue. There does seem to be player specific unit lists though. When it does this stuff, it might only check the player specific list for buildings. At any rate, it shouldn't be more comlicated than changing the owner id, possibly moving the building between lists (simple linked lists, not too hard to do I'd imagine), and then just to be sure, set a boolean value in the player record to tell it to recalculate all those morale values during the next game cycle.
I believe it recounts buildings when calculating those values. If not, you might need to update a count for that buliding type. I doubt it's necessary though.
Of course, that's all assuming a simple .DoTransfer() doesn't work.