This post needs way more support. There is a mod that does this already with 75,000 unique downloads! The only reason I'm here is because the mod is crashing my game for some reason, or else I would have just used that and been done with it. This needs to be a thing, especially considering castles are auto upgrading troops for me in a way I don't want; first, that it will slowly upgrade some troops along a path I don't want, and second, if I use a troop and it is capable of leveling (and I don't want to level it) and I put it back in the garrison, it immediately levels up when garrisoned with enough experience.
The best example of this is the Imperial Trained Footman. At this level, they are cheap to maintain and have javelins (which I have never seen them throw, but they're there). Every time I want to put them in a garrison after a successful campaign, they all upgrade to guys with spears instead of javelins (which I really don't want). And now they cost more.
This is also an economy thing; now my money is bleeding because I have troops I never wanted or asked for, I use them until they're dead, get more recruits and upgrade them where I want them (costing more money) and the process repeats. I love that we have a way to passively train troops, but we need a lot more control over it.