There is a game option for "all AIs immediatly declare war on any human they see".
There is also a victory condition "Galactic Peace for x years" (Actual positive treaties, no contact dosen't count)
Other than that, you just have to sign a treaty with someone in order to cooperate
There was a thread a while back about how to really integrate two empires into a single government: you'd gain all kinds of advantages, such as being able to prevent "allied" empires from entering your territory, dividing the racial point costs, etc.