Terraforming in Galciv2 works by researching the terraforming branch of the tech tree (Planatary improvement -> Soil improvement -> Habatat improvement -> Terraforming) and each tech after Planatary improvement will add 2 or so more tiles to the planet (I think that one tile = one planet class level).
There are indeed random events that can and will transform planets, There is the full blown event which has been showcased in a recent play example, A random colonizational event in which you have a choice (Feed your peoples life force to an amplifier or leave the device alone) or a United Planets meeting where a formerly uninhabitable planet suddenly becomes a class 13 (or thereabouts).
I heard rumors of a planetary creation tech but I'm pretty sure it was scrapped...