I believe that the oft-cited analogy with learning a language is quite to the point. You need to learn (i.e., copy) words, phrases, and simple sentences, and after a lot of practice you will be able to form your own sentences and express what you want to convey. You can speed up that process from copying to self-expression by total immersion, i.e. by maximally exposing yourself to the new language.
So what does that mean for learning how to improvise in a certain style? First of all, immersion of course means listening to the greats as much as possible. Try to be able to sing your favorite solos. Copy (play) them on your instrument, and try to understand why certain phrases work well over certain chords or chord progressions. After having learned many solos and copied many licks or "basic building blocks", you'll be able to come up with new melodies in the style that you've been working on.
Note that improvisation is mainly about two things: hearing melodies in your head, and being able to play them instantly on your instrument. So it is advisable to combine everything I've mentioned above with general ear training, and what I'd call "instrument-specific ear training", i.e. the ability to play everything that you hear in your head.