I can't really see a way to keep it in a recognisable form. Colonial rule isn't sustainable, as we saw by the mounting pressure we came under in India, and once one thing goes (and by 1900, India was pretty much going) everything wobbles. But I don't really see how Imperial Federation would work terribly well. As Faeelin points out, there's a point at which it's an Indian Empire, which Britain has no interest in. To make it workable means economic development, economic development means an educated middle class, an educated middle class means a movement for more autonomy. You can either concede more and more independence to the colonies, who will eventually just move to full independence (as happened OTL) or make Britain effectively subordinate to them by centralising, which isn't going to happen (but see thoughts about commies below).
EdT has done two interesting takes on the idea. In AGB, he imagines that Britain remaining an independent actor on the world stage with more resources and prestige thanks to no 2nd world war could result in real strategic co-operation amongst the Old Commonwealth and various friendly regimes in the former empire. It's not an "empire" as much as a power-blow, but it's the nereast plausible thing, I should think.
In FabR, it seems he had created the conditions for a *communist regime in Britain which wants to spread socialism across the world and so has no interest in giving independence to anywhere and is entirely willing to use brutal repression to maintain itself. It, of course, is "anti-nationalist" and doesn't care if it does end up as something of an "Indian Empire".
britan could have easily retained indian as a part of the empire even after 1945 without much difficulty.the main reason the british was because the british govt after ww2 was a anti colonist govt and plus the americans had also put pressure on the british to leave india[source-the march on delhi]as early as 1944 when american soilders provided supplies to indians during independence marches during the year 1944
the things working in th favour of england was the the princes were loyal to the british and they held nearly half of india under their cantrol and their subjects were loyal to them.
the army was also loyal to the british all the top of the anti british movement there were 1 million people in the army at the same time there were 2 million soilders.
so the only thing the british need to do is keep the local rulers both landlords and princes happy and thry would keep all disisents quiet.
except for this a economic development is required to keep the large number of educated people employed and away from the communist.
Physically speaking, we could have retained India for longer than we did, but it would have come at a massive cost to both nations. We had uietly recognised the reality of the situation during the war, at the latest.