The NSA is subject to oversight from all three branches of government. So, to the point that you don't believe two or three entire administrations are/were actively working for a foreign power, you can reasonably assume that the NSA is not committing treason.
A lot is going wrong there, but there are limits imposed by the transparency and rule of law. Compare that situation to a country like the Russian Federation.
But I can falsify the assumption about the effectiveness of oversight with cases from overreach that happened in the past.
So oversight probably isn't effective enough for agencies like the NSA and I am reliant on first hand information such as provided by Edward Snowden. Which have shown that it happened again.
I'd say your very examples are proof that oversight does work, in general.
And you are imposing your personal views on those doing the overseeing, namely the branches of government. From their point of view, such "overreaches" may not necessarily be that far. Also, the respective presidents didn't only know about the programs, they ordered them. And the oversight committees mostly new about that, also.
I'm not saying that nothing went wrong, but the level of oversight in the US system of government does provide better "worst case" guarantees than in many other nations. And in the end, pretty much every significant wrong-doing seems to come to light, often through the political process or in case that is too slow, the media.
Of course that is not to say that any number of people employed by or contracted to the NSA are not committing treason or any of myriad other felonies under cover of NSA-provided secrecy.
The only check on that is their higher-ups' jealousy of their income, provided they know of it.
The FBI runs counter-espionage, and a whole host of regulations make sure that it is quite hard to abuse a security clearance. Of course it still happens, but nowhere near as much as if those systems weren't in place.
Which of course stopped Snowden from collecting gigabytes of random stuff and writing it to NAND flash cards, thus we don't know any of this.
The people in counter-espionage are not subject to such regulations, nor are generals, and the evidence is that the only people they are used against are those who make any kind of fuss about rule-breaking or, you know, felonies.
A lot is going wrong there, but there are limits imposed by the transparency and rule of law. Compare that situation to a country like the Russian Federation.