I am trying to create drupal 8 roles and permissions programatically. My current approach is to have a module that when install it will generate those set of roles and permissions defined by the module. It would be more like a background Module, where no form is needed or anything. My problem lies that I really don't know where to start the the roles creations since no form is needed, I mean should I create them inside a hook?, if so which hook?, any other place?
I really don't know if this is the best approach, still a newby on drupal 8. Any suggestions will be greatly appreciate it.
Thanks in advance