Welcome to the community! From what little I know of Egglockes, I’m pretty sure Legendaries aren’t usable. Someone can correct me if I’m wrong but similar questions to yours have popped up in the past.
Edit:
I believe this is similar to what you are asking.