According to this GameFAQs thread, yes, you can.
I'm taking their word for it as I have already finished Ultra Necrozma (without the help of any legends), and cannot test it myself. I could not find any other sources which specifically specified, so I'm leaning towards this being true.