The designation could allow Germany’s intelligence agency to surveil and investigate members of the far-right party. The AfD says it plans to appeal the ruling.