From what I know, they look at the full moon with their tails still intact before they turn into great apes, or "ozaru" as it is called in Japanese.
How does their transformation work?
Saiyan's have an ability which allows them to transform into a Great Ape, which comes along with a massive power boost making them even stronger.
The premise of your question basically answers how the transformation happens. With reference to what exactly happens after, apart from the transformation change as described, the Saiyan's power increases 10 folds.
You can read more about the transformation here.
According to the Dragonball Wiki:
In order for the transformation to take place, the Saiyan needs to have a tail, as the glands responsible for initiating the transformation are located exclusively there. The Saiyan also needs to absorb at least 17 million zeno units of Blutz Waves through the eyes to initiate the transformation. Blutz Waves are found only in sunlight reflected by a moon. If there is no moon, a planetary body will reflect the same amount of rays. The easiest way to achieve this is to gaze at the full moon, making Saiyans similar to werewolves in this aspect. If any clouds covered the moon and/or a planetary body, it would block certain amounts of the radiation. Vegeta once made himself transform by firing Power Ball, which is a "fake moon" reflecting the requisite amount of Blutz Rays into the air, and then staring at it. A device on board Saiyans' Attack Pods also project a hologram of a moon that was realistic enough to allow Blutz Waves to be reflected in the event of their landing on a planet that lacks a moon, as evidenced by an incident where Gohan went Great Ape while training for fighting the Saiyans prior to their invasion due to Goku's attack pod reactivating.