I have been looking for this answer myself for a library which just needs to create some value objects (services) for other services, and I felt like all these services in YAML (with long unique names) were polluting the service configuration compared to defining the value objects without a service name in PHP.
In regular applications this is actually not a problem when using a current Symfony version (3.4+) where all services are private by default, as the service container will notice itself if a private service is only used once and then inline it (so the name will not be used), resulting in exactly the same service container code as when you define the service without a name in PHP.
So as long as you declare all the services as private (or use the defaults in Symfony 3.4+) they will be optimized accordingly (and removed if not used).