Nintendo never said that all emulation is illegal. Nintendo just does not like that their current gen is being emulated and lot of games are easily available on pirate sites for everyone. Otherwise Nintendo would have tried to shutdown emulators for previous systems too. They were especially worried about the Switch 2 being emulated easily with current emulators, as it doesn’t seen too different. I think that’s all to it.
However, there are still a number of ways that emulators can violate the law. For example, the Nintendo Switch has certain “technical restriction measures” that prevent it from playing pirated games. If a Switch emulator seeks to bypass those measures, it opens itself up to legal trouble.
Which law exactly? There are exceptions for making personal backup copies. So its not really court tested law and we don’t know if it violates the law. As the article said, these cases never went to court and we don’t have a decision by law. Nintendo did all of that out of court.
Nintendo went even further than that:
https://tech4gamers.com/nintendo-linking-emulator-trafficking/
And they absolutely have said that emulation is illegal in the past:
https://www.slashgear.com/1572585/are-video-game-emulators-illegal-answer/
On their website, they name emulators in a list of “illegal activities” they want people to snitch on:
To report ROM sites, emulators, Game Copiers, Counterfeit manufacturing, or other illegal activities