I am not sure whether a PC's consciousness, memories and knowledge are related to their personality or their mental stats (in particular, INT and WIS). My doubt comes from a practical situation, that is, a wizard that casts True Polymorph or Shapechange on himself, becoming another intelligent creature. With True Polymorph the mental stats are replaced, while the alignment and personality are retained. With Shapechange, the mental stats are retained too.
The True Polymorph spell description say:
The target’s game statistics, including mental ability scores, are replaced by the statistics of the new form. It retains its alignment and personality.
The Shapechange spell description says:
Your game statistics are replaced by the statistics of the chosen creature, though you retain your alignment and Intelligence, Wisdom, and Charisma scores.
The spells' descriptions do not say anything about the creature's memories and prior knowledge. While it seems quite obvious that a PC (or other character or monster) that casts Shapechange remembers who he is, the same cannot be said for True Polymorph. I think that the manuals don't say anything about subject's memories. Are they retained or changed?