If you generate them with completely legitimate stats, moves, met location and level, and everything else then they are indistinguishable from regular legit Pokémon.
If any of their data is incorrect (a move they aren't meant to know, an improper met location, etc) then they'll simply create an error if you try to trade or battle them online. So far people don't seem to be getting banned for it (as you might have gotten a hacked Pokémon from someone else and Nintendo doesn't want to punish the innocent).
Hacked doesn't mean illegal, and legal doesn't mean "legit". As long as the Pokemon is legal, the rest is moot. You're NEVER going to get a "hacked" pokemon that would get you banned in an online trade, period. The game will simply refuse the trade unless the pokemon can exist naturally so there is literally no risk using anything you get in WonderTrade.
- hacked (obvious hacks, Pokemon with over 31 in a single IV stat, over EV training, weird moveset (eg. Magikarp with Diagla's movesets) - can't be traded through Wondertrade and the like because the system recognizes it as a "cheat" pokemon
- legal (Pokemon within parameters of the game. Kind of finicky, which is why different programs exist to validate Pokemon's legality. It's also what proper modded Pokemon look like - completely OK within the game.) Can also refer to PowerSaved/PKSM'ed Pokemon - I've used it to create shinies from fully raised Pokemon in my games and I've used it to EV train new Pokemon. It is what a "good genned" Pokemon looks like - not distinct from an actual Pokemon inside the game.)
- legit (Pokemon that are fully raised/trained without any outside influence like PKSM, PKHex, Powersaves.)
It's bad form to trade someone a legal genned Pokemon if they don't know about it, but I've done giveaways on holidays with genned Pokemon. (Last year, for Chinese New Year, I gave out massive amounts of shiny magikarp over wonder trade. This year, I'm thinking of doing a shiny "dog" Pokemon.)
I've done it for years (starting from X/Y) and then going to SuMo. Haven't done the genning for Ultra Moon because I'm running through a Nuzlocke. No bans, no whatever online because I've always done the "legal" Pokemon thing.