IIRC, level ups happen with any boss fight. It means that all 40+ character stay uniformly strong (barring whatever stats differences in individual strengths/weaknesses).
Actually that's not how it works at all. I said it doesn't make sense, but I do actually know how it works. The bosses give you star levels, which give you a window of opportunity to level your stats. These stat gains don't get shared with everyone, I'm pretty sure (might need to test this). Once you beat the next boss, the opportunity is lost. So if there are two bosses in quick succession, you should go back fighting some ~7-10 battles (per party) if you want the stats. The gains don't come from beating strong enemies in new areas like in normal games, but from how many battles you fight. Usually you gain stats after each battle, then not any in a few, then MAYBE a big stat gain again after not getting anything.
This system is an OCD nightmare and not very good if you wanted to do something like trying to get the max potential out of your unused characters in endgame. While this doesn't necessarily get in the way of the game, there isn't really anything I can praise about it either. It seems like some failed attempt to stop powerleveling. FF XIII did it much better.
Actually, you get an immediate boost once you gain the Star Level, but additional fights nets you a few minor stat points here and there which anybody can get (which means lots of switching people out for the sake of a few points more), and one big boost that can only be gotten once per Star Level (the big boost isn't as large as the immediate boost but it will skew stats more towards people you favor or use more frequently and discourages using characters that you might like but might have fallen behind somewhat). Really though, only Serge really shows this off since he's constantly a member of the party and he only goes from JRPG Protagonist syndrome sufferer to overpowered JRPG Protagonist syndrome sufferer.
(Edit: I may have gotten the stat boost priorities mixed up and only the minor boosts occur once per Star Level while the secondary boost can happen to anybody who fights a couple of battles after one. Additionally, I have no idea what goes on with characters that are unavailable due to a late joining time or due to getting shipped off with not-Surge during the midgame.)