The motor and the speed reducer can be flanged
What you're talking about is a flanged rigid coupling, which you can design on a mechanical design.
You can use the flange or the coupling directly with the motors and the reducer
Of course, you can use the transition flange if the size is not appropriate