In every of Gold/Silver/Crystal/HeartGold/SoulSilver you need to beat Elite 4 first, then obtain ticket (from prof. Elm) on SS Aqua from Olivine City to Vermilion City.
If you are done restoring the power plant you can go to the magnet train