They simply out-source it to a corporation that would be willing to do what it takes to collect the information, or as much as possible. It's not uncommon for the three letter agencies to delegate the illegal ramifications to a "corporate" entity, freelancers, mercenaries, etc... The FBI hires gangsters and criminals to "gather information" or "assist in investigations" when they need something done that is highly questionable. It's a really grey area, and a very large market.
Snowden for example succeeded in pinning "illegal surveillance" on the NSA, when the work was contracted out to the American corporate security-cartels, although he is a very rare exception, especially considering he is alive and not jailed.
Don't they get around some of this "you can't spy on your own countrymen" thing by just swapping data with the British surveillance service i.e. "I'll spy on yours and you spy on mine and we'll swap afterwards"?
Snowden for example succeeded in pinning "illegal surveillance" on the NSA, when the work was contracted out to the American corporate security-cartels, although he is a very rare exception, especially considering he is alive and not jailed.