To transform into Metal Sonic in Sonic Heroes on the GameCube, you need to enter a specific button sequence during the loading screen. On a GameCube controller, that means pressing A, B, and Y in order, repeatedly, while the level loads.
One important detail: this trick only works with Team Sonic. Get the timing and inputs right, and you'll take control of the metallic version of Sonic.