We also had same requirement to serialize Security entities. We are able to serialize using 'Legacy' way of serialization as @nickwesselman mentioned here.
But Sitecore stores serialized files in default format such as .user for Users and .role for Roles. But we need in YML format. For that we changed the SerializationType
to YAML
format in below config App_Config\Sitecore\CMS.Core\Sitecore.Serialization.config
(We created a patch for this change as Sitecore recommendation)