The text of true polymorph says (emphasis mine):
Creature into Creature. If you turn a creature into another kind of creature, the new form can be any kind you choose whose challenge rating is equal to or less than the target's (or its level, if the target doesn't have a challenge rating). The target's game statistics, including mental ability scores, are replaced by the statistics of the new form. It retains its alignment and personality.
Regarding Intelligence checks, the PHB states (emphasis mine):
An Intelligence check comes into play when you need to draw on logic, education, memory, or deductive reasoning.
This indicates to me that memory is directly tied to your Intelligence and a polymorphed creature could potentially lose memory if their Intelligence changed, but later in the description the spell specifically calls out memory loss (emphasis mine):
Creature into Object. If you turn a creature into an object, it transforms along with whatever it is wearing and carrying into that form. The creature's statistics become those of the object, and the creature has no memory of time spent in this form, after the spell ends and it returns to its normal form.
Since memory is specifically called out in part of the text it makes me think that memories should be retained unless specifically stated.
Specifically, if a red dragon were true polymorphed into a human, would they retain their memory of being a dragon? Likewise, would they retain the memory of being a human once the spell ends and they revert back into a dragon?