Not sure why folks keep repeating that Trump can legally release information.
His freedom to release information shared with the US by another country is governed by the terms of the agreement. A British PM isn't "legally" permitted to release US secrets. Those secrets are held within the framework of the Five Eyes international cooperative architecture.
It's only "legally" permissible for him to release information if the information is US-created or the terms of the international agreement allow it.
Of course, such agreements rely upon trust and reciprocity. You can't expose clandestine agreements to the light. The damage he has done is to the reputation of the US as a reliable partner. The conclusion is correct that folks will withhold information about their most sensitive secrets from the US because its President is a brag.
And there is enormous value in cooperation.
Comes back to Erickson's point. Trump is an idiot.