Hi Peter being mostly acoustic and fingerpicking, I am bound to learn songs with a particular picking and melody pattern. The only improv happens when I mess up, and I try to dig myself out of a hole whilst playing . So what I say here below, comes with a jolly big disclaimer - and is more based on what I have seen others do, than my own personal experience.
When we jam together with our Bluesharmonicaplayers, and we have more than 2 guitars playing a blues shuffle pattern, I do decide on the spot how I will play the chord sequence of a song, which is given, and try and find a chord voicing and a rhythm that will complement what the others are doing. Because there are not many options there that is relatively easy, but it is not predetermined. I sometimes may try adding a riff to link the chords together, but it is safer to have that riff committed to memory in advance so as not to throw the groove. I haven’t studied nor agreed in advance with the others. I’ll just find out. As a last resort I will just try to find some right notes, and play a solo line, or some arpeggiating, without much advance thinking about it, and without having a library of licks to help me out. Each time I try that, it will be different, and its not a proper solo, because the acoustic will not cut through two other guitars strumming or a blues harmonica. It just adds a little colour.
Maybe one day, I will be able to play a solo, but I am not consciously studying it, other than having more or less committed the minor pentatonic / blues scale in 3 positions to muscle memory.
I guess if music is like a language, there are different ways to learn it. You can learn it as a baby would, repeating certain words and patterns, and have a response to them, and reacting to that response. You can try and learn it as an adult, from the useful phrases section of your travel guide, and not having had the benefit of the feedback, be in for some rude surprises when after you arrive in the country of destination, attempting to apply your newfound linguistic skills.
What I am trying to say here, is that in learning how to solo in Bluesland, it is probable that you will improvise rather than copy someone else’s solo verbatim. Maybe the solo would be too difficult for your skill level, but you can borrow a part of it, and you fill in the gaps with licks that you do know. Maybe on the other hand, it would be a song that you don’t know, but you still get the solo during a gig - what do you do? I guess improvisation is a part of learning, learning to solo and coming up with your own solo’s to given songs, which you can commit to memory or just coming up with a solo during a jam.