Since so many attempts were tried and failed in OTL the best way would be to look at them and see what PoD you could do to change the outcome. The fact there was so many attempts and none succeeded makes me feel it is almost impossible. Attempts OTL- First Mexican Empire included all of Central America except Panama. Central American Confederation, all of Central America except Panama plus Los Altos of Mexico. Bolivar's proposal which Chile and Argentina refused to attend and Brazil was not invited. Gran Colombia, included Venezuela, Colombia, Panama, and Ecuador (subsequent territory lost to Peru and Brazil); union of Upper and Lower Peru (Peru and Bolivia); Nicaragua, Honduras, and El Salvador attempting to revive the Central American Federation. Even successful Latin American nations have had problems staying together. Mexico has had revolts from Yucatan, Chiapas, Freedonia, Texas, California, Sonora, and the Republic of Rio Grande, and even today with the Mayans.
Geography problems have lead to too much in cultural differences and especially in the 1800s a problem with too far/difficult for timely communication and movement of people and goods and cultural diffusion.
A Trans-American highway at an early age or a larger interest in a merchant marine could help. But Spanish colonial policy never allowed for the colonies to develop such as the 13 BNA colonies did. And the Trans-American Highway in OTL was a USA-led project during WW2 and once that was over it fell away from completion since it was no longer a strategic help to the Super power.