You can Google for “grammatical error correction” to find recent research. The goal is usually not to create rules this way, but to directly get the correction. Basically the same way Google Translate or DeepL works with e.g. English/German pairs, but this time with incorrect/correct pairs.
A related approach is described here, but it doesn’t rely on incorrect/correct sentence pairs.