Legislators nationwide are advancing bills to curb immigration enforcement and limit cooperation with federal agents.