This can be set using the filenamePattern property on the Formats list of a transform output preset:
https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.media.models.format.filenamepattern
This example shows how the property can be used:
https://github.com/Azure-Samples/media-services-v3-node-tutorials/blob/fd7b07e0d39deff54e174fef7ab6a1790da9ed8e/VideoEncoding/CreateTransform_Job_PresetOverride/index.ts#L172