Hi,
You should create a flow that gets triggered "When a new record has been added" dataverse action. Be careful that action require Premium license.
As the source table, you must select Notes or Attachments table. Within this record, you will receive what kind of entity is being referenced therefore it is recommended to check _regardingobject_id which gives you the name of the related entity.
Once you get the related record, you can move it to -as recommended- SharePoint.
Based on your logic and make the future documents accesible, you must also create sharepoint document location for this particular referenced record, otherwise in the Related > Documents subgrid, you'll see nothing.
I saved 5GBs of storage with this method.