How to use filter hook “the_posts” with a function that refers to $this?

As you can see in the documentation, the 2nd argument passed to functions hooked to the_posts is the WP_Query object.

To access it you need to define the 4th argument of add_filter(), $accepted_args, to 2, so that you can accept it.

Then you just need to accept 2 arguments in your function, and use the 2nd argument to as the WP_Query object:

function wpse_313327_filter_past_events( $posts, WP_Query $query ) {
    if ( $query->is_single() ) {
        return $posts;
    }

    if ( $query->is_feed() ) {
        // etc. etc.
    }

    return $posts;
}
add_filter( 'the_posts', 'wpse_313327_filter_past_events', 10, 2 );

error code: 523