You can't. As far as I know the game calculates "perfect troop composition" for given party/garrison size and wage limits, and it tries to achieve this "ideal" party/garrison by upgrading some troops and by dismissing the other ones.
I wish there was an option to disable it for parties and garrisons. In the current state of the game, even if I fill one of my clan parties with Legionaries or Battanin FIan Champions, the party leader will still throw some of them away, because they want to have some cavalry.
It deeply hurts my soul when I try to make an overpowerd party with some custom troop composition for a specific tast and AI just destroys it. I give so many great soldiers to my family members for free, but they don't want them like a toddler throwing a tantrum, and they just spit on this beautiful gift and my not so beautiful, but friendly face.