That accent didn't just happen overnight either, as Boseman explained to Jimmy Kimmel. The actor actually had a sort of dry run in another film and was able to build off of that for Civil War.
"Well, what I did for this particular role was, you know how comedians, how you guys, you'll do a small comedy club before you do the big show. I did an independent film called Message From The King. I play a south African who is coming to L.A., so the fish out of water story, so I used that as my small comedy club performance to find my dialect coach to sort of find my base for an authentic African dialect. So I had an accent in that and sort of just built off of that with that dialect coach and sanctioned by Marvel."
Thankfully he didn't go with Kimmel's idea of heading to Wakanda, Illinois for his accent studies. I imagine more than a few fans would've been a bit upset.