Purely anecdotal, but I am not banned despite hacking. I have a TLDR at the bottom, but for anyone wondering, I have done the following:
-Played before release. Did not go online before the street date, knowing I could always argue that my internal clock was set incorrectly If I were to get banned
-modified legal Pokemon. No illegal stats or moves, no bank stuff before release, etc. 100% legal and usable online. Also deleted mons to save time of releasing one by one
-modified items and currencies. Extra pokebeans/bp. Never touched FC as it was somewhat connected to online play, something I avoided out of paranoia. Also added extra rare candies, battle items, etc. Nothing stupid like 999 key items or mega stones
Modified the Pokedex. Added the Chansey line as seen/owned to finish the alolan dex. I did NOT check the "complete dex" icon as I feared it registering illegal stuff as owned, such as male salazzle or shiny locked legendaries. Also having every gender, region, shiny, etc seemed blatant
Used game sync. No drastic or illegal changes in between syncs. I didn't magically gain 9999bp in two hours, my game timer didn't decrease, my ID, gender and skin color did not change, etc
TLDR; what I believe caused it for most people are one of the following
1) owning illegal things in the dex. Shiny locked legendaries, illegal gender, etc. Manually adding an entry seems fine as long as it's added correctly
2) drastic or illegal changes in between game syncs. Magically changed gender, name and ID while gaining 2000 fc and 999 mega stones in between saves only an hour apart? Do you have duplicates of a key item you only get once and is not tradeable? All red flags
3) to a lesser extent, poorly genned mons being used online. There are hack detectors, but they aren't perfect. A newbie might make a mistake such as add egg moves but not relearn moves, copy/paste a smogon set to a pre-bank mon with post bank moves or transfer only moves, etc.
Of course, until less conflicting answers are posted, one should avoid all online activity if you have hacked