Get only selected custom taxonomy

Before your first foreach loop, at the top of the script, define an empty array to house what you’re after:

$taxWith_product_cat = array();

Now since you’re looping through all taxonomies and all terms therein, in the terms loop foreach($terms as $term), check if the current term is product_cat. If it is, add the terms taxonomy to the new array:

if ($term->slug == 'product_cat ')
    $taxWith_product_cat[] = $taxonomy;

There you have it. Now at the end of the script, you have an array of taxonomies that contain a term of product_cat:

echo "<pre>".print_r($taxWith_product_cat,true)."</pre>";