Question: where do you go after you beat team magma in their 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.