Every five levels a character gains a legendary feat slot. Legendary feats are not gained like ordinary feats, they are quested for, found in odd places, or come to characters rather interestingly in the heat of the moment. Not every character/PC will have one, for they are rewards for outstanding role-playing.
Like feats, legendary feats do have prerequisites. It can be any combination of: feats, skills, base attack bonus, class features, levels in a class, etc. Additionally legendary feats also have their own unique prerequisites in the form of legendary feat slots and can also have other legendary feats as prerequisites.
Legendary feat slots are used up once a legendary feat is taken. The slot requirement represents the focus/training needed to acquire a legendary feat. PC’s cannot easily teach another a legendary feat. For the quest to attain them is what makes them special. Meaning the DM will not allow PC’s to easily teach another PC the legendary feats. This is to keep intact the prestige of legendary feats. The same goes for making new characters, they cannot start off knowing legendary feats, no matter the starting level. Though exceptions can be applied based off of background and role-playing.