I don't know of anyone who has been banned (by GF/Nintendo) for hacked pokemon. I don't even think the people spreading Zeraora to SM via bots were banned.
If a pokemon is considered egregiously hacked then you will simply not be able to play online. While you could theoretically be banned, again, I have never heard of confirmed cases of this. Things that would be considered are illegal abilities, illegal pokeballs, illegal moves. That is pretty much it.