Late 18th/early 19th century is particularily rich in the terms of feasible divergences, as one might expect. You should narrow down your querry.
If we are to focus on making Mexico a feasible great power, for example, here is one possible way:
- For various reasons, the USA in the early 19th century are more battle-hardened, aggressive and militaristic. Throw in some additional border conflicts since 1783; in addition to the usual Indians, probably some fighting with Britain in the Great Lakes region, also a Spansh-American War in the early 19th century, with an armed conquest of Louisiana and Florida. Some things that are probably redundant but might make this better: have the Legion of the United States survive on the grounds of general awesomeness (as well as appropriateness for the battle-hardened theme; clearly militias just won't do!) and have the Hamiltonian Federalists - possibly even the man himself - take power (their Anglophilia might be problematic, but either it or they will cease to be relevant by the time the important part comes). The basic idea is to have a meaner and more militarily-efficient USA.
- Later in the Napoleonic Wars, have the various difficulties with Britain plus apparent possibility to land-grab while Britain is busy lead to a war over Canada. Ideally it will bog down; the Americans will make limited gains, but fail to conquer all of it; the British, meanwhile, will be forced to dump more resources there as opposed to Europe.
- France still will lose the Napoleonic Wars, but: a) it will be later, b) they will probably be able to bleed Spain even whiter (whether in a drawn-out and increasingly brutal war or by subjugating it more succesfully and then using the Spanish as cannon fodder when things get more desperate) and c) Britain will play a much less significant part and generally will have less influence, with the Holy Alliance becoming more hegemonic (an interesting tangent in and of itself; without the strong British influence to opposite it, the Holy Alliance might achieve more in Europe itself, but it is also likely that it will get pulled apart earlier, probably into Prusso-Russian and Austro-French blocs). This is important because now Britain will both want and have to focus more on America.
- The war in Canada will then end in limited American territorial gains in the south, and Britain holding out further in the north (this may not even be the most plausible outcome, but it's possible and it fits in, so let's go with that). Anglo-American rivalry grows ever worse; the OTL cooperation on the Monroe Doctrine is naturally out of question, not to mention useless. With the Holy Alliance conspiring against itself and Spain being way too devastated to do anything about this, the Latin American colonies break away far more easily without having to fight off the huge Spanish reinforcements. At which point an Anglo-American cold war will commence in the former Spanish territories, especially as the revolutionary enthusiasm fades and the early states begin to enter crisis. The early power struggles will see the various factions align with either Britain or the USA.
- Anyway, we finally get to Mexico. In this world, it will not be nearly as war-torn or unstable as in OTL, having won the independence war far earlier. That said, the big, mean, expansionist USA is just plain scary and after the early radicals die out or get overthrown, the Mexican ruling elite will inevitably turn towards Britain. And Britain will eagerly turn towards Mexico, because it's well-positioned to halt further American expansion, in theory. And so we get massive British investments and other help for the Mexicans.
- Incidentally, without a prolonged independence war to help develop caudillism and elevate men like Iturbide and Santa Anna (as well as weaken the bourgoise), power after the radicals will probably fall to the moderate pragmaticians; I even have a name for you, Lucas Alaman, who in OTL was Anglophilic, comparatively sound economically and opposed to American expansion; he was apparently able to slow down the American immigration into Texas in OTL somewhat. He also had a grand industrialisation plan, which, while implausible otherwise, should work out pretty well with British investments. Also, a more war-torn and increasingly oppressive Europe should provide a liberal and rapidly developing Mexico with lots of more... reliable immigrants that would be used to counterbalance the Americans in the frontier regions.
Could a lot of stuff go wrong? Certainly. But this is probably one of the best ways to allow for a reasonably powerful Mexico with such a late PoD. With admittedly major luck it will be able to hold on to its territories, industrialise succesfully and, towards the late 19th century, become a great power in its own right, though probably still an ally of Britain. I could elaborate further on this if you want, as there are lots of highly interesting geopolitical and colonial developments to consider here, amongst other things.
I realise that this might be a bit too detailed, but you may consider it a loose guideline. The problem is that it's hard to write something realistic about super-Mexico; there are few ways to do it right.