Once you catch a Legendary, it's gone. If you don't, it can be encountered again. Try to find wormholes of every colour but white, as white ones only have UBs. If they have a flowery effect around them, a Legendary is guaranteed.
Once you find the Legendary you want, save in front of it. If it's shiny, well done. If not, soft reset and try again and again until it's shiny.
Note that sort resetting only works for Legendary Pokemon, regular wormhole Pokemon cannot be soft resetted for shininess.
Hope I helped!