Here the FrameworkExtension class, you can use the ``form.type_extension.csrf.enabled`` parameter

```php
        if ($this->isConfigEnabled($container, $config['csrf_protection'])) {
            if (!isset($config['session'])) {
                throw new \LogicException('CSRF protection needs that sessions are enabled.');
            }
            if (!isset($config['secret'])) {
                throw new \LogicException('CSRF protection needs a secret to be set.');
            }
            $loader->load('form_csrf.xml');

            $container->setParameter('form.type_extension.csrf.enabled', true);
            $container->setParameter('form.type_extension.csrf.field_name', $config['csrf_protection']['field_name']);
        } else {
            $container->setParameter('form.type_extension.csrf.enabled', false);
        }
```