I implemented a pretty simple system for "Epic Classes". Each of these classes is 10 levels. When you advance a level beyond 20th, you can either take a level in these classes, if you meet the prerequisites, or you can multiclass as normal. The 4 Epic Classes are: Spellweaver, Martial, Leader and Shadow.
Spellweavers are very simple. You have to be a 20th level single class caster (bard, cleric, druid, sorcerer, wizard) to take a level as a spellweaver. At each level you gain a spellslot and you get to pick one spell that is always prepared/known. The slots, gained one per level, are: 6, 7, 8, 8, 9, 9, 10, 10, 11, 12. I have homebrew spells of levels 10 to 12. HP gains per level are a d6.
Martial is more complex, but essentially it just ramps up your speed. You get more attacks, more movement, higher AC, etc... You also gain Legendary Resistances and Legendary Actions. You also gain 2d8 hp per level. You need to have 20th level in a single class to take it.
Leaders gain auras. Each level you can either add a new aura or enhance the radius of an existing aura. Auras heal, grant resistances or immunities, cause fear saves in enemies, etc... You also gain proficiency/expertise in skills and get a "minimum ability score" that drags up any low scores you have so that by the time you're 30th level, you have no ability score below 18. HP gains are d8. You need to have 20th level in a single class to take it.
Shadows are the stealth/scout build option. You need to have a 20 or higher dexterity, 20 levels in a single class, and proficiency in stealth. They get 10 different abilities which only a person that has taken them gets to know, generally. These are supernatural abilities (magic that does not use the arcane weave) that allow them to do the impossible including passing through walls, being in two places at once, and negating everything that happened to you during the last round (even if you were killed). They gain a d8 per level.
Advancement to the next level requires a legendary act. Legendary acts are not just 'killed an ancient red dragon' - they're changing the course of history in a way that will be spoken of for generations.