Within that framework, plenty of things are clearly out of bounds, like copied source code. I would argue that re-implementing chunks of code that you know to be economically valuable and unique to your former employer from memory is just as problematic.
Now, by out of bounds, I mean breach of a civil contract. I don't see the criminal aspect.
Basically, there's no need to erase your memory, you just need to distinguish exchanging your time for money from exchanging your former employer's IP for money.