It’s simple really: write libraries and frameworks yourself and use them for real projects. It will give you a great understanding of what makes a quality library/framework and make you a better programmer.
Think about it as a hobby. Most people have time for hobbies. The rest spend way too much time on social media or watching YouTube. Manage your time better.
Thank you for the advice which is no doubt well-intentioned.
But don't kid yourself. If you use your spare time for research and development to solve problems at work, then it is not really a hobby, it is just you working overtime for free. If that makes you happy, good for you, but it doesn't change the fact that time and resources are limited. The time is just cheaper in your case.
And yes it might also happen to benefit the job I do currently. But that is not the #1 priority.