Export custom module strings for translation
You can give Translation template extractor a spin. While there is no official release for Drupal 8 available (yet), there already is a development version that seems to work for your use case when using the GUI:

https://www.drupal.org/project/potx/releases

Using composer, just install it like

composer require drupal/potx


After enabling the module, you'll have a new menu entry Configuration > Regional and language > User interface translation > Extract (/admin/config/regional/translate/extract)

There you can extract language and module specific translation templates from your custom module's PHP files.

Disclaimer: As mentioned, this module's Drupal 8 version has not been released yet. It may contain bugs and is not feature complete/en par with the 7.x version. Better use it in your development environment only.