The contract stipulates that patents will be shared during the cooperation period, but how can the other party apply for patents by itself in case of breach of contract?

First of all, does the patent applied by the other party infringe your original patent right?

If there is no infringement, then it seems that nothing can be done.

If you are infringed, you can collect evidence, sue according to law, and find lawyers in the intellectual property industry, not lawyers in non-intellectual property industries. Although many lawyers have lawyer qualification certificates, they don't know much about the intellectual property industry.