Simply use pokecheck. It is your friend. Go to Pokecheck create a profile and follow instructions. Then check legality status.(Only works for gens 4 and 5).
I don't exactly know what he's talking about "hacked" because you can't hack it without doing it yourself or buying a game used and they did it. But way's to know is if they're stats are over the maxed limit, they got moves they can't learn, non catchable Pokemon at a lower level than what it evolves, etc.