Custom classes inserted based on module used

In my layout.erb partial, I have the following on my main element:

<main role="main" class="main <%= current_page.data.main_element_classes || "" %>">

Then in my views partial, I have this in my Yaml:

---
title: Homepage
layout: default
main_element_classes: with-video-header  with-secondary-nav
modules:

  - path: video_header
  - path: secondary_nav
---

This works but what I would like to do is add these classes automatically each time a module is included into a page view. Is there a way to do this using a helper?