If you're wanting it to span across the entire game, it's actually fairly easy. Me and a few others asked about it a while back, and poccil posted a balanced level script, which he was nice enough to package into the newer versions of essentials (even though i don't think it's referenced anywhere). If I'm not mistaken, the levels of wild pokemon are defined in PokemonEncounters on two lines (I'm not sure why there's two tbh). They read level=encounter[1]+rand(1+encounter[2]-encounter[1]), but you can change both of those lines to level=pbBalancedLevel($Trainer.party). That should do what you're asking. If you get an error saying the method is undefined, let me know and I'll send you the script. It shouldn't be a problem unless you have a really old version though.