A few ways I know of that are reasonably reliable.
A good way to is to try put it into the GTS, if you are playing X and Y. As you may know the DS generation's GTS was closed down in May 2014, so if you are playing those games you cannot use the GTS. You have the tag '3DS' though so I'm assuming you're playing Gen VI. Just put it into the GTS and ask for an impossible Pokemon to make sure the Pokemon doesn't get traded in the ten seconds it's in there - trust me, if there is a good Pokemon on there it could be gone in seconds.
The blue pentagon method Quagmire mentioned in the comments is unreliable and I do not recommend it. The blue pentagon method is where you can look at the summary of the Pokemon, and in the corner of it's picture there might be a blue pentagon representing Kalos. This only represents if the Pokemon was caught in Kalos. It is not a legality checker.
Also, a legality checker is the best way to go. Pokecheck is currently under maintenance, but I'm unsure if this is a temporary thing or not. If it's not then the GTS method is the best way to go, if not then you can use Pokecheck and find out if your Pokemon is legal or not.
It should be noted that if the Pokemon was obtained by cheat code but is still legal, there is no real way to check it. But an illegal Pokemon is easier to reveal.
Remember, you can always check everything manually although there are many variables in Pokemon so this is a bit harder to do. For any other person who might also be looking for answers and are playing the DS games, migrating is a great why to find out if it is legal or not although it will cost you. If you wish to check manually there are a few variables to consider, and probably more:
- Stats (check with an IV or EV calculator somewhere on the internet)
- Movepool (check on that particular Pokemon's page on PokemonDB or Serebii and Ctrl+F the moves the Pokemon has)
- Location (is it obtainable in that location?)
- Date It Was Obtained (it could be possible this was changed during the hacking process)
Those are the main factors in determining an illegal Pokemon, but it's always good to use the previous methods, they can be a lot more reliable.
Hope I helped. :)