I caught Pokémon that required Power Up Stardust of 5000 before, and I was at level 30 or 31, and I could power up a Pokémon all the way with 6000 stardust needed at that time.
I thought it is by "remainder arithmetics", meaning it is modulo math, that if you are at level 27, then the maximum level of Pokémon that you catch will be level 26 (calculated by the Pokémon ID number, modulo your level, to get the remainder as the level of Pokémon that you caught).
Now I can power up a Pokémon all the way to needing stardust 7000, but the Pokémon I caught are still requiring a maximum of 5000 to power up. Does it max out at this level? (I think they are level 30 Pokémon). I think for a hatched egg, the level max out at 2500, and they are all level 20 Pokémon.