You would need to create an environment where it would make sense for the different colonies, and Commonwealth realms, to want to remain federated. To do that, at the very least you will need to make Britain much more attractive as a potential anchor, and the outlying areas much less afraid of losing their distinctiveness and their autonomy to a foreign government (again).