def transform_data(data, transformer):
    """
    Read a dictionary and apply transformations using the
    `transformer` Transformer.
    Return a tuple of:
       ([field names...], [transformed ordered dict...], [Error objects..])
    """
    if not transformer:
        return data

    renamed_field_data = transformer.apply_renamings(data)

    field_names = renamed_field_data[0].keys()

    if transformer.field_filters:
        renamed_field_data = list(transformer.filter_fields(renamed_field_data))
        field_names = [c for c in field_names if c in transformer.field_filters]

    if transformer.exclude_fields:
        renamed_field_data = list(transformer.filter_excluded(renamed_field_data))
        field_names = [c for c in field_names if c not in transformer.exclude_fields]

    errors = transformer.check_required_fields(renamed_field_data)
    if errors:
        return field_names, data, errors
    return field_names, renamed_field_data, errors