Stone Lake's last comments contain the gold nuggets. I have always been very confused about this. The crucial difference is to note how stats are changed directly and how with bonuses. Bonuses ignore caps while direct changes don't.
A recent example here is that in recently published XCF 3.5, where installing TNI reduces your current sanity by 20 %, but as it changes the stat directly, it can be regained through training. (Earlier similar proportional losses happened with protean revival, at least.)
Most transformations are mostly or entirely based on bonuses, so the order in which they are applied is not so important.
However, one transformation might open up a path for another more quickly. As a specific example, you should usually install TNI (which gives among other bonuses +5 to MELEE) to agents with 60 melee or slightly less, so that after installation, they would directly be eligible to get martial arts training. Because getting those last points to get your MELEE up to 65, this can fast track the progress quite a bit. And spartanism applied to a rookie is another story, allowing access to martial arts without any training at all (though with the veteran agents and all I doubt many will need that shortcut anymore).