Using Cheat Engine is not usually a criminal offense by itself, but it can violate the terms of service of many games. The bigger risk is not legal trouble, but account suspension or banning if the tool is used in an online or multiplayer environment.