The president’s escalating conflict with federal courts goes beyond what has happened in countries like Hungary and Turkey, where leaders spent years remaking the judiciary.