It depends on what kind of Pokemon you're trading for.
It is possible to create a hacked Pokemon that follows all of the game's rules and therefore is impossible to detect, and is "legit". It's a lot of work, especially for event legends, but it's entirely possible.
The most obvious tells are in the "Met" information. Many hackers don't really bother to keep this information within the bounds of the normal game, or remotely relevant for that matter. Pokemon met at "---------", for example, or met at lv 100, or met at level 1 but not hatched from an egg, that kind of thing.