An investigation into how Trump’s emergency declaration expanded military power, blurred legal lines and helped spread the use of military-grade tech.