I have 5 years experience under me belt. I'm a good developer but maybe with worse presentable skills
For public speaking, if you feel you need some training, find a local Toastmasters and join it for a while. If the first one you try isn't good, try another - different clubs operate differently and so suit different people. But Toastmasters is designed to fit around a work schedule, so I find it better than taking a class.
If you already feel like you have a handle on public speaking, join a local meetup and offer to speak - I have never met a Meetup that isn't scrambling for speakers and usually fills them in with corporate schills like me cough.
Build an audience. Start a newsletter and send them updates every time you publish something new (if you find yourself especially productive, limit your newsletters to once a week or twice a month). Submit your work to places like Hackernoon and here.
If you can't do this on your own, do it for your current employer - that's more or less what I did. Talk to your management team about your interests in developer advocacy and ask them what topics you can talk about. Your marketing team in particular will fawn over you if you do this. Developer advocacy is not ALL marketing, but it part of it is an arm of marketing, so working with them will get you far pretty quickly.
I;d say it takes about six months to build a following if you stick to it and a full year before you really get something resembling a handle on it all. Be patient, though, and stick with it if you enjoy it. If you don't enjoy it, don't push it - I love programming and still do a fair amount if it on the side, but it's not at all my full time job and not something I find I have a lot of mental space to afford proper focus to when I need it like I used to be able to. That may also just be aging, though.
I still think of it as the most fun job you can have in the industry.
On the advocate end, as a developer, you already know how your peers work, what frustrates them what delights them, etc. Expand your audiences and see what other developers using other languages in other organizations are doing and start to build your own thesis on what makes for a good developer experience - portals, documentation, outreach, code and API design, etc.
Read some technical books and blogs focused more on the design of the things you;re interested in rather than the usual nuts and bolts O'Reilly type stuff. Get a sense for what others are advocating for in your area of focus and determine whether you agree or not. More importantly, work on articulating why you agree or don't. Like, really dive into that stuff - that's where you'll find the kind of knowledge that will help you better build a strong thesis you can share with others as well and find solutions and opportunities to improve processes and tooling. Then, start advocating for that better way - experiment with things, talk to your peers and get their feedback, then collect it all and publish it.
I became passionate about APIs and API design a while back because I was managing an API program that, while solid, left a lot to be desired. I spent a lot of time researching APIs and API design - we're talking 2009 here - and there was just starting to be a wellspring forming around RESTful APIs. But one of the key challenges I saw was that no one really could explains what RESTful was - even the experts.
I set about transforming the SOAP API we were using into a RESTful design - not coded, mind you, just the design. Even though I wasn't on the engineering team, I brought my design to the VP of engineering and they wound up using it as they refactored the code.
This eventually led to a gig as a strategy consultant with an API management company where part of my job was to go on stage and share our research in order to build our credentials and sell our services. I took my interest in API design and turned it into a new service for us to offer our customers, then went on stage all over the place to introduce my methodology. I've basically been riding that wave ever since.
Cool story- a number of years later, I had a meeting in Lisbon with a major Portuguese company to help them define their digital strategy. As I was delivering my high level overview of API architecture and design, I saw this dude who was part of the engineering contingent furiously typing on his phone. I assumed I had lost him and figured, "Fine, I'll make sure he;s paying attention when I get to the tech stuff."
At some point, I brought up my API design methodology, and he suddenly blurted out something like, "THAT'S who you are!" He was trying to figure out why he knew me and had been Googling for the answer. Turns out, he and his team had been using my site to train themselves on API design and were rather devoted about it. That was nifty.