DependencyInjection/Compiler/FosUserCompilerPass.php
public function process(ContainerBuilder $container)
    {
        /** @var Definition $definition */
        $definition = $container->getDefinition('fos_user.user_manager.default');

        if('FOS\UserBundle\Doctrine\UserManager' === $definition->getClass()){
            $definition->setClass('Akuma\Bundle\UserBundle\Doctrine\UserManager');
        }

    }
public function process(ContainerBuilder $container)
    {
        /** @var Definition $definition */
        $definition = $container->getDefinition('fos_user.user_manager.default');

        if('FOS\UserBundle\Doctrine\UserManager' === $definition->getClass()){
            $definition->setClass('Akuma\Bundle\UserBundle\Doctrine\UserManager');
        }

    }
You can modify the container here before it is dumped to PHP code.

@param ContainerBuilder $container