How to save the definition of an entity?
Yes, the module providing the entity type needs to be enabled for the entity to work correctly, and any module using that entity should include the defining module as a dependency. Drupal modules are generally not factories that produce configuration and can then go away (the major exception being modules generated with the Features module which can behave this way at times), they generally provide ongoing functionality that Drupal will expect to be available on demand.

In your case Drupal loads the class from that module under a variety of conditions (not the least of which is anytime you load an instance of that entity) and so needs to continue to be active as long as you use the entity. That module is also the place to define any special behaviors of the new type of entity you have defined (like changes to the save/load process, or other actions the entity may provide).