With 100% certainty you can't but you generally get a feeling that something is off, in the case of an actual straight out and out cheat it's easier because typically 1500 rated players don't calculate accurate exchanges 12+ply deep.
The "smarter" cheats use the engine only when they need to and those are harder to spot but again it's moves that make no "sense" with the direction of play - be like playing sunday league football and having the chubby dude with the beard take of down the pitch like Messi.
Mostly they catch them by running engine(s) over the games afterwards and looking for correlation between moves played vs what the machine wanted to do.
The funny ones are the players who drop a piece from a blunder then immediately start playing like Kasparov for the rest of the game.