Sometimes you need to add a label to a form-element that cannot have it's own label. For instance with the ClockPicker for Mendix
and I have run into this before, there are more use cases.
You can add the label-widget, but it does only partly create a label. What is missing is the option to assign the label-widget to a form element that it has to follow.
Convert you widget to a pluggable widget. and you can get your label for “free”. see docs
Your suggestion by it self, is probably hard create, as the label should be for a specify the the for=id, this should be the input element, which by it self does not need to be the first one or only one. In that case you should set in the widget the aria-labeledby inside the widget itself.