While I am sure Nintendo, Sony, EA et al would just as soon fit you for a long drop and a short stop for even considering it we do live in a world where "your device, your rules" is largely still intact. In the US two cases, both amusingly enough from games, tending to go here (Sega vs Accolade and Galoob vs Nintendo, aka the game genie case), however there is also the DMCA which came later that tries to make bypassing protections illegal outside an increasingly long list of circumstances (most of which do everything they can to not have game consoles fall into that
https://itlaw.wikia.org/wiki/DMCA_Exemptions_to_the_Prohibition_on_Circumvention ). Some other places will also attempt to ban the sale or importation of flash carts and mod chips, the US tending to go the other way and you will hear phrases like "substantial non infringing uses" (such a thing being one of the main things keeping emulation absolutely fine and legal) but that is not so clear cut in all this.
To that end they have to show some form of damages from your actions, which is mostly a civil matter (if you are being sued by someone not the government then probably a civil matter). That means they have to catch you, and care enough to mount a case (win 1 million in court against me and even if you took my entire wages for life and net worth you will not get that).
If you used or distributed copyrighted works without permission then that might count. If you mess with their online services (the freeshop thing seems to be blocked now but that might fall under theft of utilities or something similar as you are using their bandwidth) then that could also count -- using cheats in online games tends not to see people pinged in the US but I can see a path.
If they detect you then they can ban you from their services -- their services, their rules and not much you can do there -- more fool you for buying a device locked into a vendor's network rather than allowing you to run your own servers.
Owning a copy of the relevant work at the time of the use generally means you are not being a pirate. This does however mean plain old homebrew if said homebrew is an emulator or media player playing pirated games/songs/videos/books/... can come into that one.
If you want to get lost in the weeds then it is possible -- some would argue using Nintendo's emulators to play a game you own in cart form without owning a copy of the base emulator would count, and that means many doing injection could fall under it. Some also ponder what different versions mean (having a Japanese copy likely does not entitle you to playing the NA version, however whether you would be allowed a simple bugfix 1.1, though the 3ds has title updates so moot point most likely).
The nature of translations and ROM hacks can also vary (there have been cases for people running subtitle websites, and fan translations would fall under something called derived works even if that is likely to apply more to the hackers that made it) but I have never seen anything there I would deem relevant in this -- some hackers get asked to take translations down when said game is being released for real and one case was a really awfully made patch that contained a good chunk of the game that was not needing to be patched, and for an actual case there was one years ago with some people making hacks was dropped in short order which is about all I have
https://www.theregister.com/2005/02/10/tecmo_sues_xbox_game_hackers/
https://www.theregister.com/2005/05/27/tecmo_drops_ninjahacker_suit/
Fan games might also count in this -- depending upon what goes when the takedown notice comes a lot of them will say "assign us any copyrights to your game" as part of the deal.
Anyway look at me pondering things like it is cool (even law students would deem this a boring and pointless nerd exercise).
Short version. Don't lose any sleep over anything here. As long as you are not dumping games to share online, running a ROM website within a place they control, downloading ROMs from somewhere they can see, selling discs filled with ROMs (what most flash cart sellers/mod chip installers/modifiers tend to get charged with, even if the final press piece does all it can to downplay that) or breaking their online services then of the possibly millions that might have visited this site and our interest in it all if it goes down outside then nobody gets anything other than a naughty boy letter if they are found downloading a torrent of a game without a suitable VPN. If indeed you are installing themes and whatever passes for 3ds homebrew (compared to the xbox, GBA, DS, PSP and Wii then the 3ds is as nothing when it comes to cool and interesting homebrew, though I suppose you could be doing GBA and DS homebrew on it) then Nintendo is even less likely to go after you in case you win the case and thus it becomes clear cut that it is legal rather than the "scares some people and that is good enough" thing that Nintendo and their mates try to cultivate.
"If you hack you lose online" is the generally accepted mindset in all this, any online you do get being but a nice perk and you might have to work for it (hiding from detection methods often blocks things that would be hackers and homebrew types would like to have). That said 3ds bans are unlikely to happen again (it is a dead console after all, would not serve much purpose) and is 3ds online options actually something you truly care about?