When you battle it in the Ultra Megalopolis, it knows Smart Strike and Dragon Pulse. Smart strike can only be taught by TM, and Dragon Pulse is via move tutor. If the Necrozma is wild, how does it learn these moves? Also when you catch it at Mount Lanakila it doesn't know them.
Let's say this: Ultra Necrozma is a part of the story as Gamefreak made it, so they have decided that they give Ultra Necrozma move tutor and TM moves just to make battling Ultra Necrozma really hard. (P.S.: IT WOULD BE A LOT HARDER IF IT HAD EARTHQUAKE)