How do I implement a sub-module? I can't find anywhere documentation on how to create a sub-module inside a module in Drupal 8. I have created a custom module for translations I am trying to enable as sub-module.

In the main module, can I simply create a sub_modules folder and place my sub-module, including the submodule.info.yml file and the translations folder? I'm guessing I have to add something into my mainmodule.info.yml file but I have not found anything to help me.
Drupal doesn't have the concept of sub-modules. It just happens that it looks for modules in the directories where it expects to find modules, recursively. For example, if you install the CAPTCHA module, Drupal will find also the Image CAPTCHA module, and allow you to install it.

Drupal will not install it automatically, nor will it handle it differently from any other module. This means, for example, that the module still needs to declare its dependency from the CAPTCHA module, if it requires it, which is what the Image CAPTCHA module does in its image_captcha.info.yml file.

name: Image CAPTCHA
type: module
description: Provides an image based CAPTCHA.
package: Spam control
core: 8.x
dependencies:
  - captcha
configure: admin/config/people/captcha/image_captcha


Usually, developers put any "sub-module" in the modules directory, but this is not required from Drupal, nor is it followed by every developer.