The most successful terrorist training technique developed so far is to do this very illegal stuff while providing religious training. Some imams speak largely in quotations from the Koran, which contains lots of material about making war on the infidels (non-Moslems). The most secure of these training sessions are those conducted in the language of the old country (Arabic, Urdu and so on). Some of the most promising recruits were born in the West, and they usually speak the language of their parents well enough to learn how to be a terrorist. Finally, much of this stuff is done in a mosque.
The combination of using religious training for cover, speaking a foreign language and conducting the sessions in a mosque, makes it very difficult for counter-terror operatives to even find out that this sort of thing is going on. The mosques will spot a non-Moslem pretty quick, and the social nature of these places makes it difficult for an undercover policeman to just come by and join up.
The police have been very dependent on inside informants, but these have not been very abundant in some countries (especially in Europe). Once the police get wind of the terrorist training and indoctrination, they can use some conventional techniques, like bugs or secret searches. This has yielded many arrests and convictions, especially now that many judges are no longer impressed by Islamic clerics, with foreign accents, protesting religious persecution.
But hundreds of radical imams continue to preach violence, and help provide training for those who want to make war on infidels, even if that means killing their neighbors.
Over the last two decades, Saudi Arabian religious charities have installed hundreds of radical Islamic clergy in mosques throughout the West. Even though some of them have openly backed Islamic terrorism, few have been sent back to the Moslem country they came from. Several dozen of these imams have been responsible for encouraging, and sometimes helping organize, terror attacks. But since September 11, 2001, most of the pro-terror imams have learned to be more discrete.