Question: what do you do after you beat team magma hideout?
Answer: Go to Slateport. Professor Stern will be in the process of being interviewed in front of museum or the ship port. Talk to him, and then something will happen and Team Aqua will steal the submarine. Then you go to their hideout to the right of Lillycove.