How to create a chooser button to choose categories?

In a custom Module, how to create a chooser button to chose the Product categories like module widget in Magento 2 default?

See how the categories chooser is implemented on a backend product’s screen.