You can enact some things locally on the client, and it might fend off those that don't want to spend the time to get around it, but there is no way to truly stop people from breaking apart your game (creating and sharing cracks or serials, etc.).
The best that you can hope is that you create a system that deters common skiddies.
With that said, the best way that I would think to get around this is to have a server authenticate the client; So when the game is played, the client needs to check in with a server. Much like anything else, this can be bypassed by a multitude of ways (ranging from sending a phony authentication, or even bypass the server altogether). If you have the client 'phone home' when it is run, you can also make note of characteristics of the computer that is running it (ip, mac, computer name,... whatever); However, as with anything... these too can be forged or emulated. --- also be careful about storing PII like someones IP, the legality and practices behind that vary from place to place.
In the case of using an authentication server, if two players with the same game serial number (or account/cd key/etc.) logs in, then you can respond to such an event (banning that serial for instance, or showing a warning).
If I had any parting words, they would be to say that piracy is a huge issue (in quantity and magnitude) for a reason --- it is nearly impossible to eliminate, the best that anyone can hope for is to mitigate it.