The National Academies of Sciences, Engineering and Medicine had been under pressure from Republican leaders, including President Trump.