Cheat Engine (CE) is a memory scanner/debugger. Its legality depends entirely on context and intent.
Rule of Thumb: If it affects another player's experience or the game's economy — don't. Offline, single-player, your copy — your rules.