The best way to gain XP in BTD6 is to learn Monkey Knowledge first. Moreover, monkey education is a valuable perk that boosts the XP rate.