If your branch contains a Dependabot change then a Github action should kick in and validate it. However this seems quite erratic and I'm not sure about the logic as to when and if it happens.
If you view the configuration file you should see a validation badge in the file's header. Therefore the easiest way to validate the file is actually just to edit it directly on the main branch and check the validation on the badge (which is linked to a Github Action run.
It would be really nice to have an official CLI validator for the file format, particularly as it is becoming more and more complex.