add extra parameter in default hook in wordpress

You don’t really need to add this parameter, you can use global $post;

function bp_add_visibility_to_activity( $content, $user_id, $activity_id ) {
    global $post;

    $post_id = $post->ID;
    // do stuff
}

add_action( 'bp_activity_posted_update', 'bp_add_visibility_to_activity', 10, 3 );

Note that $post->ID will return null if your are not in a post or page, so you maybe need to check the post_id value before any treatment, to avoid error or notice.

Hope it helps !