Order posts by custom column using pre_get_posts

I found out the answer myself.

There are other filters that let you adjust the query before it’s run:
http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_clauses

The posts_clauses filter runs before the query gets executed and is essentially the sum of all filters that run immediately before it.

Apart from posts_clauses, there are several more precise filters that modify only a single specific clause:

  • posts_where_paged
  • posts_groupby
  • posts_join_paged
  • posts_orderby
  • posts_distinct
  • post_limits
  • posts_fields

So in my case, all I had to do was to use posts_orderby filter.