Our second worst president ever, GW Bush, had the idea of sending men (many whom were purchased by the U.S. through a bounty program) to Guantanamo for indefinite detention, and torture. The thinking was that this was a piece of land out of reach by the U.S. Courts. They were wrong, it was not.
Our worst president ever, Trump, came up with a different idea. Pay another country to take, torture and hold men (in this case El Salvador but other countries might also step in). The thought being that sending the men to a whole other country can keep these men outside the reach of U.S. Courts. I do not think this will work either.
It took just over two years for the U.S. Supreme Court to step in and allow lawyers to visit with the men at Guantanamo and to represent them in lawsuits. With our current Supreme Court the question is a little trickier but I don't believe that these men will lose their right to pursue legal action against the U.S.. I do not believe our courts here in the U.S. will rubber stamp our illegal transfer of these men, but time will tell.
There are also other resources that can be put to pressure nations like El Salvador. El Salvador is a signatory of the Hague Convention and the International Criminal Court. El Salvador is also a member of the United Nations, the Organization of American States, the Central American Parliament and the central American Integration System. Right now the El Salvadorian president does not understand the quandary he has stepped into by accepting money for the men that the U.S. has sent to him. However, the fact that he was not willing to accept men from other Central American countries confirms that he has given a tiny bit of thought to the issue. I think he will be learning a lot more in the weeks to come.
Again, time will tell.