Getting category before saving post

Yes, and you’re quite close to it. Just use the $postarr parameter of this filter:

add_filter( 'wp_insert_post_data' , 'wpse128138_wp_insert_post_data', 99, 2 );
function wpse128138_wp_insert_post_data( $data, $postarr ) {

    // run this only for posts
    if ( 'post' != $postarr['post_type'] )
        return $data;

    foreach( $postarr['post_category'] as $category_id ) {
        if ( is_wp_error( $category = get_category( $category_id ) ) )
            continue; // invalid category, just pass

        // and here you can safely use the $category object
    }

    return $data;
}