Serialize an object to a YAML file.
obj (Any) – The object to serialize.
Any
file (str) – The file path where the YAML data will be written.
str
SerializationError – If serialization to file fails.