Improve serialization example

Question was raised by https://github.com/symfony/symfony-docs/issues/2225 and a PR was also provided for the serializer component https://github.com/symfony/symfony-docs/pull/2402