Why do you want to do it in a single trigger?
There is a native to turn of EXP gain for a specific unit, it is clear this will be needed.
Next you will need some form of subsystem to handle what units are normal or knighted.
1 Trigger is used for the level up detection, if a unit levels up to his limit (you test if he is knigth or not to get limit) you then turn off his experience gain and set his experience back to the nearest whole level (otherwise it will overshoot).
1 Other trigger us used to govern the knight system (runs when a unit becomes a knight) and makes him known as a Knight. This trigger would also test if the unit was level capped and if so would turn his experience gain back on.
A final trigger is probably needed on death to remove the units and the unit from all systems that referenced it. Although units still leak even when removed, it is a lot better than leaving 100s of unrevivable dead hero units active in the game.