Well If I remember correctly after you capture/ defeat the Red Gyarados, you have to go and talk to Lance. He will tell you that the Red Gyarados wasn't acting right and that it was forced to evolve. He will then ask you to help him out with his investigation and that a strange radio broadcast is being transmitted from Mahagony Town and this may be the cause of Gyarados being forced to evolve. He will then tell you that he will be waiting in the Souvenir Shop in Mahagony Town for you to arrive before flying away on his Dragonite.
When you get to Mahagony Town and enter the Souvenir Shop he will command his Dragonite to use Hyper Beam towards a random individual. He will then confirm that the strange radio broadcast is being transmitted from this location and walk up to the golden cabinet in the room moving it revelling the entrance to the Team Rocket HQ.
Hope I helped :)