Right after you get the Eon Flute, use it and soar. When you're flying, you should see some red twinkles. Fly to one of them. If it says Mirage------ then go there. Just explore around the island, and grab the tm there. Then go back to the nameless cavern and there should be a loop. Hopefully this answers your question. Hope I helped!
Ps: I don't think you need max happiness on any of your Pokemon :P