I'm not sure if this is readily known, but it seems to me that XP gained by your towers is translated directly into the XP on your account. That being said, this guide is set out to maximizing the possible XP gains in a given game.
This guide requires that you are familiar enough with the game to consistently set yourself up with an almost auto-win scenario. What does this mean? After the initial set up, you reach a point where you can safely leave the game running and afk your way to victory.
You will want to have Ganesha down and The Dark Forge in range along with your main tower. My preference is to have Ganesha in the very middle square so that she can affect a majority of the towers in play. You'll also want to have a Scientist down in the nearest square to the spawning waves (you can fill in as many as you can if you know you'll still be able to clear all the levels).
Now, for every tower on the field excluding your main and the Dark Forge, equip 3 Key of Wisdom along with 1 Dark Forged item. Your main will be equipped with the Blade of Darkness when your forge is of high enough level to drop it. The Dark Forge should be equipped with 4 Norls Guardians.
In order to maximize the gains from my Scientist, I pumped him full of speed potions. If your carry tower isn't secure, however, make sure you don't skimp him on potions.
With this strategy I've consistently gained 3-4 levels on each endless run I take. The only downside is that it takes a little bit of constant watching over the game instead of a set-and-forget style once you're carry is beefed up enough.