Module installation order
For me this sounds pretty simple to solve. In your custom module just set a requirement:

name: Foo Bar
description: 'Lorem ipsum.'
package: Custom

type: module
core: '8.x'

dependencies:
  - dynamic_entity_reference:dynamic_entity_reference


By that you ensure that dynamic_entity_reference exists and is enabled when your module gets installed. That's it. Except I misunderstand you and you are instead looking for hook_module_implements_alter to change the order of modules calling a certain hook.