You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: preserve_types.rb
    path of file: ./repos/rails_event_store/ruby_event_store/lib/ruby_event_store/mappers/transformation
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module RubyEventStore
  module Mappers
    module Transformation
      class PreserveTypes
        def 
    
        def transform(argument)
          case argument
          when Hash
            transform_hash(argument)
          when Array
            argument.map { |i| transform(i) }
          else
            registry.of(argument.class).serializer[argument]
          end