It is not done in a transaction, but one at a time. This is something which you have to take care of in the new modules. i.e. if an old module calls a new one you have to make sure that the old interface is still there and does not crash. This in turn makes it very important for you to load the modules in the correct order to avoid an new module calling an old one and expecting an interface to be there.
If you do very small incremental changes to your system this tends to not be a problem, but if you want to do a big bang upgrade once every year it will become more and more complex.