I used to be a dirty Godless hacker for a few weeks and I've found that the only 100% accurate way to tell if it's hacked is by checking if it registers in the Pokedex. No hacked Pokemon no matter what you make it with will show up in the Pokedex (unless you've already caught a real one in the past).
Other than that, take it to the move tutors in B2/W2 and you may notice it can't be tutored the right moves, another indication that it's a dirty hacked fraud.
You can take a Pokemon to the Train Battle area thing and talk to the first guy, he'll tell you your Pokemon's IV's. If it's shiny with "outstanding potential overall" from GTS it might be fake. But, RNG Abuse is a method to catching "perfect" legit Pokemon.
As far as I know, the baby of two hacked Pokemon is legit. So if you really want to push the limits and hack, you can hack the parents and breed for a Pokemon, then release the hacked trash Pokemon.
In case you take offense to this, I use hacked Pokemon too. But only on special occasions like a fun Metronome battle with a friend, no way would I try to pass a hacked garbage on GTS as real. I wish Nintendo would fix GTS. Not only does it fool noobs into believing they're getting real ****, but it spreads hacked Pokemon into unknowing games. Who knows how many more hacked Pokemon there are in existence, that's why I try to only trade with well known poke-peeps in the poke-community.