def transform_record(self, pid, record, links_factory=None, **kwargs):
        """Transform record into an intermediate representation."""
        context = kwargs.get('marshmallow_context', {})
        context.setdefault('pid', pid)
        return self.dump(self.preprocess_record(pid, record,
                         links_factory=links_factory, **kwargs), context)
Transform record into an intermediate representation.