### Elasticsearch Version

main

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

MacOS

### Problem Description

Currently, transform state persistence failures are being retried with a constant interval (`60s`).
This is different to how other types of errors are retried (exponential backoff).
We should implement exponential backoff for state persistence failures too.

### Steps to Reproduce

n/a

### Logs (if relevant)

_No response_
x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformFailureHandler.java
}
    }
    /**
     * Terminate failure handling by failing the transform.
     * <p>
     * This should be called if the transform does not run unattended and the failure is permanent or after the
     * configured number of retries.
     *
     * @param failureMessage the reason of the failure
     */
    private void fail(Throwable exception, String failureMessage) {
        
        context.markAsFailed(exception, failureMessage);
    }
    /**
     * Get the number of retries.
     * <p>
     * The number of retries are read from the config or if not read from the context which is based on a cluster wide
     * default. If the transform runs in unattended mode, the number of retries is always indefinite.
     *
     * @param settingsConfig the setting config
     * @return the number of retries or -1 if retries are indefinite
     */
    private int getNumFailureRetries(SettingsConfig settingsConfig) {
        return Boolean.TRUE.equals(settingsConfig.getUnattended())
            ? -1
            : Optional.ofNullable(settingsConfig.getNumFailureRetries()).orElse(context.getNumFailureRetries());
    }
}