In its own bubble it will be legal (and PKHeX will flag as legal), but when you account for everything in the save/in the world we live in outside of the game, then it’s actually illegal
(have the Mew in the save with *any other Eng Pokemon that shares your TID/SID*, then use Verify PKM button, and the output would flag it.)
However, nothing stops you from keeping the Mew, even if it’s illegal.
If your OCD stops you from owning anything illegal, then RNG the TID/SID. This way, even when it is flagged illegal/fishy, you can rest easy.