You can indeed add a filter to get_next_posts_link
, but it has a different name, namely next_posts_link_attributes
Complete code would look like this:
add_filter('next_posts_link_attributes', 'wpse_230552');
function wpse_230552() {
return 'class="iamclass"';
}