I could be wrong, but I cannot see a way to easily do that without changing core code. It looks like the navigation nodes are built up in:
/lib/outputrenderers.php:render_navigation_node()
You can see in that method how it does it:
$attributes = array('tabindex'=>'0'); //add tab support to span but still maintain character stream sequence.
if ($title !== '') {
$attributes['title'] = $title;
}
if ($item->hidden) {
$attributes['class'] = 'dimmed_text';
}
$content = html_writer::tag('span', $content, $attributes);
So one option is to change that core method.
Another is to do it with
javascript on page load, to add the class to any navigation nodes without hyperlinks.
I am not sure if it is possible to override that `render_navigation_node` method in your own class in the theme. It may be, but you would need to explore the code more thoroughly to see if it's possible.