The New Orleans and Magdeburg attacks show that the UK “must not get complacent” to the terrorist threat, former Prime Minister Theresa May has said as she hailed new legislation aimed at keeping people safe.