widget code can be in the theme, a plugin, or (some of them) in the WordPress core.
In that case, looks like the HTML was pasted into a text widget.
As s_ha_dum mentioned, one place to look is in the WordPress (WP) core.
WP uses a base class called WP_Widget
for it’s default widgets – see [wp-includes/widgets.php].
Each default widget extends from this class – see [wp-includes/default-widgets.php].
And they’re all registered at the end of this file in a separate wp_widgets_init
function.
If the form you’re looking at is a widget it could be coded and registered in [wp-includes/default-widgets.php].