this is actually an amazing concept for a story, there are so many dynamics that could arise out of this.
It would just be a standard part of burials for someone to be assigned the brain of the deceased, with rituals to make it less disgusting and kinda hide that fact.
But since you're gaining their memories, it would also be kind of harrowing to be the assigned inheritor, you're basically just taking their entire mind into you, so you might end up designating an "avatar" person who is never given a chance to form their own personality and instead just spends their entire life carrying the sum total experience of those before them, and only rarely would someone else consume the memories of another if it's vital that they specifically gain that specific knowledge.
Like good lord, imagine having a legitimate god-emperor who is the physical embodiment of all those who have come before, who you yourself will almost certainly become part of when you die (unless your body is lost)..
Then imagine that person dying and the brain being lost, cutting off the 10 thousand year unbroken lineage.. terrifying