Here is the solution I ended up with. This may help others too.
$taxonomy = "product-category";
$args = array(
'taxonomy' => $taxonomy,
'orderby' => 'name',
'order' => 'ASC',
'hierarchical' => true,
'hide_empty' => false,
);
$the_query = new WP_Term_Query($args);
$categories = $the_query->get_terms();
if ($categories){
foreach($categories as $category){
$ancestors = get_ancestors( $category->term_id, $taxonomy );
$category->ancestors = $ancestors;
$category->depth = count( $ancestors ) ;
if($category->depth === 3) :
echo $category->term_id . '-' . $category->depth . '-' . $category->name;
endif;
}
}
First, I used WP_Term_Query Class to create the terms object and build my custom query then get_terms() to retrieve all the terms.
Inside foreach loop used get_ancestors() function to return the array containing the parents of the given object and $category->depth to get the current depth.