Add a counter beside menu item label

You can wp_nav_menu_objects filter hook and you can compare your menu label with the condition and append your cart count. check below code. code will go active theme functions.php file. tested and works.

function modify_cart_label_in_nav_menu_objects( $items, $args ) {
    if($args->theme_location == 'primary'){ 
        foreach ( $items as $key => $item ) {
            if ( $item->title == 'test'  ) {
                $item->title .= '('.WC()->cart->get_cart_contents_count().')';
            }
        }
    }
    return $items;
}
add_filter( 'wp_nav_menu_objects', 'modify_cart_label_in_nav_menu_objects', 10, 2 );