Spell Reincarnate, 5th level Transmutation (Druid [& Bard]):
The reincarnated creature recalls its former life and experiences. It retains the capabilities it had in its original form, except it exchanges its original race for the new one and changes its racial traits accordingly.
Traits &/or powers that the humanoid 'keeps': stuff 'learned' or gained via the soul-spirit-psyche-mind go along to the next body. This includes class traits, skills and many spells. Thus, a gnome adopted near birth and raised by High elven parents will always 'know' longsword and longbow proficiency (even if not able to physically use them until they become some other random being).
Traits lost with previous body: things that are obviously from the body. This includes ability score modifications, 'dark' vision, extra limbs and so on and so forth. Thus, a 'Drow' / dark elf cannot keep their racial spells in their next iteration unless Reincarnated or Truly Polymorphed back into a 'dark' elven form.
Sample list / humanoids of concern:
Xvart: this is a fragment of a demigod. Should the next iteration not simply be another Xvart?
Derro: seems to have magical abilities linked to an enchanted 'insanity' or touch of chaos. They obviously should 'keep' their insanity. Do they keep their mind-resistances and ability changes that stem from this?
Flind: wields a seemingly class-specific weapon - is this device learned by specific cultists (of 'Demonlord Yeenoghu') that later transform into gnolls anyway - or is this device attuned to their race?
Nagpa: a class-specific curse given by a god. If a mere Reincarnate would end this horrible problem, you think they would have done this centuries ago.
Kraken priest: a form of worship (subclass) that alters the shape of one's body. Presume their 'fresh' body will transform over time?
Werewolf: not a 'disease' in 5e but a 'curse' that is somehow contagious, endures generations and functions a lot like a disease.
Meazel: is this species a class, similar to 'warlock'? If so, they would slowly morph back into a Meazel over time?
Koa Toa: insane god-makers - do they keep the insanity and 'otherworldly perception'? Can their 'new' forms still assist in conjuring up gods?
Many of these examples present powerful and even godlike enchantments that seem to impact body, mind and soul. It is not useful to do this in a case-by-case basis: there must be a logical rule of thumb that will support both game continuity and make plot-sense that any reasonable DM can apply.
Summation: Which curses, enchantments &/or magical abilities survive death as marks on their essence - thereby ending up in the next humanoid incarnation after Reincarnate [spell] is used?