The Dodd-Frank law and regulations put in place since the financial crisis have made the financial system “substantially safer,” Federal Reserve Chairwoman Janet Yellen said Friday in a ringing defense of the rules now under fire from President Donald Trump and J.P.