No it isn't that simple. With a new motherboard there is a new installation of the operating system.
You can transfer the data onto the other systems drives. And then format the M.2 SSD for use in the new system.
Doing it the way you envisioned would probably make it unavailable to you as the data is limited to the signed in user for security reasons in Windows 10. You might be able to get around it but it would be a pain in any case.