You save before talking to it and then talk to it, and if it's not shiny, press START+SELECT+L+R to soft reset and try again. - Be patient, it might take a while. It could take 3 resets, or 3,000... or even more.
That's one thing I need is a shiny Legend but I'm undecided on which to get. As I said before, I'll attempt Raikou.... later.