The obscure Investigations and Threat Management Service (ITMS) used tactics, including broad keyword searches on employee emails and scouring Americans’ social media for criticism of the census, to gather information on hundreds of people inside and outside the department, documents and interviews show.