Let me tell you how the "eavesdrop on Team Trump" thing could well have gone down legally, up to the point where various people were "unmasked." Basically, you figure out where you want to go and then you go there in reverse so nobody notices.
Once Trump won in November, the identity of those close to him, helping with the transition, became known to anyone who cared enough to find out. Let's say people in government, maybe NSA or FBI, maybe some little outfit we've never noticed, decide they want to (or are supposed to) legally eavesdrop on the Trump people.
First they go to NSA files and use the phone logs of Trump aides to find out what foreigners the Trump people call with some frequency. Second, they get FISA taps on those foreigners' phones and wait for Trump people to call.
Third, record those calls. Fourth, in January convince the Obama White House to change the distribution rules for such forint, to make them much less restrictive.
Fifth, and here's where they go illegal, leak the calls with names unmasked. DC loves leaks so much hardly anybody gets in trouble for them, so the risk is low.
Another possibility, mentioned by Fox News' Bret Baier tonight, is to search calls made between foreigners for gossip about the Trumpistas; it can be lawfully done. Perhaps between spies with official embassy covers and their handlers back home, in Beijing or Ankara or Managua. Their calls should be monitored anyway. In other words, let foreign spies do the eavesdropping and/or wiretapping and "share" the data with or without their permission.
Later ... it could turn out that Fox News' Judge Napolitano was correct when he claimed the leaked intel came from the Brits' MI6. The Brits may have been absolutely correct that they knowingly shared nothing with the U.S. Perhaps NSA decrypted the Brits' wiretap info without their knowledge.