Precautions when transferring a Nintendo Network ID
You will not be able to perform a system transfer if there is any Nintendo Network ID already linked to the target system.
Formatting your system will not delete your Nintendo Network ID.
You will need to use system transfer to link your Nintendo Network ID to another system. Once linked to your system, your ID cannot be linked to any other Nintendo 3DS system.