Where does Magento store the PRODUCT_HAS_WEIGHT attribute

The attribute is not stored, is only use for meta purposes by the repo and it is basically a wrapper for the weight attribute within the method customizeWeightField() of class Catalog/Ui/DataProvider/Product/Form/Modifier/General.php

Modifying the product_has_weight you will change the product type; it defaults to 'Virtual' but it will get converted to "Download" if it has downloadable data, remember that 'has' is a magic method prefix, although hasWeight is overridden on product types virtual and downloadable for the purpose of locking down a false Boolean value. The value is not specifically stored, the state will remain in the form of the product type, see the TypeTransitionManager class and the plugin Magento\Downloadable\Model\Product\TypeTransitionManager\Plugin\Downloadable, on configurable products it will be determined by the sum of the children state specified by the meta modifier.