How did Future Trunks learn the Spirit Bomb Technique?
The answer is quite simple: This is not the spirit bomb technique. 

Trunks' new form that is similar to the SSB is solely responsible for pulling in all of that energy and enabling that new sword technique he used against Zamasu.

Considering that we don't have a definition for this form we also don't know it's limitations. 

However, I speculate that the new form is a special form of SSB attained when a half human half saiyan can clad themselves in god ki. Doing so enabled him to pull on the ki of other humans to unite into his blade. Which worked because humans are according to Zamasu "made in the image of gods". 

That's only a theory but fact of the matter is that what we saw was not Trunks using the spirit bomb.