PDRs4All: VI. Probing the photochemical evolution of PAHs in the Orion Bar using machine learning techniques