They banned Sky3DS users because the headers were being shared via the ROM files, so it was easy to tell who were playing pirated copies - if Nintendo saw multiple users with the exact same header they'd simply ban those users. Since nobody does "public" headers anymore, and I don't think cias even allow for that, this hasn't been a problem for quite some time.
It's easy to say that anyone who went online before the game was officially released got banned.
But, as this would affect legitimate buyers who just got a physical copy of the game early Nintendo probably wouldn't ban based on that alone. Probably.
So, the question is, how did/does Nintendo know to ban a pirated copy and not somebody who just got a physical copy early?
One plausible explanation is that you're shown playing the eShop version of the game despite the game not being released in your region, which is an obvious red flag for a banning since such a scenario shouldn't be possible.
Other theories involve Nintendo implementing a new method of anti-piracy involving detecting the leaked cia or looking at version numbers. More specifically, detecting if you're using version 0 of either game but not playing directly off a real physical copy or if you're shown playing the eShop release but the version isn't 16/32 as it should be. Historically though, this has never been an issue and may not even be possible.
Still, to be on the safe side, it's suggested to go with versions 16/32 since those should be seen as digital/eShop copies of the game and theoretically be safe. We know that bans are dealt out in waves, so it may be too early to say whether or not anybody playing any copy of the game is actually safe.
As somebody who temporarily installed a non-leaked, apparently version 0 cia of the game after it was officially released and only opened it for a second before finding out about any of this crap I can only hope that something really sneaky isn't going on and I'm not screwed. Because I may have had online enabled and, somehow, the game update notification server (or whatever it's called) saw what version of the game I had installed even if I didn't go online in-game.
EDIT: Well, apparently there are some cases of those who did get a physical copy early who also got banned. In a selfish way, I hope that it's just a simple matter of going online before the release since that would mean I'm safe.