It depends on the continuity you're talking about. In general, when Transformers are not on Earth, they're usually on Cybertron. But this is not always the case, as it depends on the plot of the story.
For example, at the end of Cyberton, most of the Autobots left Earth in the ancient ships to build a new space bridge system. In Headmasters, they couldn't return to Cybertron. In the Movie, Cybertron is known to be dying due to the loss of the Cube, and the Autobots are settling on Earth from other places in the galaxy. Where they would go if kicked off Earth is anyone's guess.
So the whole thing just depends.