The overall harmony is B minor, a somewhat unusual key for the trombone. In the middle of the "melody," it shifts slightly to the key of A minor, and uses the A harmonic minor scale during the second "melody." A is the leading tone to B, and I sometimes believe that key shifts like these are used, not to get away from the overall harmony, but to build up the anticipation for the return back to B minor.
The solo is crazy ridiculous, as usual. It's based around the B blues scale, with a #13 (G#) acting as the melodic minor. And Shorty ends the solo by whistling up to a uber-high F#. I couldn't find any videos about whistletones, but I'm sure there are some web pages where you can read about how to improve your technique.
SPECIAL THANKS to Jesse Kovarovics for the comments!
Since this post wraps up the Backatown album, here are TWO YouTube videos. The first is Trombone Shorty jamming with The Roots and Chuck Brown. The second is a jam in the dressing room, "Let's Go Get 'Em."
Recommended Reading: Guru: My Days With Del Close by Jeff Griggs. Published by Ivan R. Dee.