A former Salafi jihadist-turned undercover operative has told the royal commission on antisemitism how he became radicalised after an encounter with the Taliban.