Metabolic connectivity as a driver of host and endosymbiont integration