YOLA, Nigeria—After seizing another village in Nigeria’s northeast last month, Boko Haram militants took a step in their transition from terror group to governing authority. They rounded up the men and ordered them to wear pants as the prophet Mohammed did, several inches above the ankle.

Otherwise, a Boko Haram commander told a crowd of men, they would be killed. “So we folded our trousers,” said Birgamus Kadams, a 26-year-old who was among the group of several hundred residents of Garkidi village the militant addressed.

...