i think jamming nicely is the goal, rather than the means. i do know bar by bar of a song by humming but i am not sure how to play them on hands thats what.... indeed, the case of being able to improv means you d need to be able to modulate everything in any pitch scale but i am not sure otherwise if the mind needs to know something to make/conpose nicely on the fly....
where to find is the question... i honestly have never seen any book goes in this specific detail either...