You do not need to amend the code to acheive this you can update the formatting for dates in magento by the following method
- Log in the Magento 2 Admin
- Click on the Store section on Admin sidebar.
- Under the Setting, Go to Configuration
- Expand the Catalog option and choose the catalog option
- Set the date and time format to your prefered format and save
This should give you the result your after. you may need to redeploy your website
bin/magento setup:static-content:deploy
Also you may need to flush the cache
bin/magento c:f
This should now give you the result your after
if the above does work the only other way would be to create an overwrite of Magento\Customer\Block\Widget\Dob and amend the getFieldHtml and getHtmlExtraParams functions to replace your with your specific date format