The standardBoth the states:
forW3 HTML 5.2 standard and the WhatWG Living Standard state (IDReference) This attribute explicitly associates the label with a form control. When presentin almost exact terms, the value of this attribute must be the same as the value of the id attribute of the form control inquote is from the same document. When absent, the label being defined is associated with the control inside the label element.latter):
The for attribute may be specified to indicate a form control with which the caption is to be associated. If the attribute is specified, the attribute's value must be the ID of a labelable element in the same tree as the label element. If the attribute is specified and there is an element in the tree whose ID is equal to the value of the for attribute, and the first such element in tree order is a labelable element, then that element is the label element's labeled control.
So it's okay to use it that way in terms of following the HTML standard.