**Affected version:** 7.12 - 7.17.7, 8.0-8.5
**Fixed in:** 7.17.7, 8.5.0

### Problem Description

A continuous transform can fail if a transform is searching at the same time as an ILM action occurs or in general anything that closes an index. This should not happen if transform is configured with a wildcard pattern for the source index, e.g. `filebeat-*`.

In a specific case an ILM policy temporarily closes the index due to the unfollow-the-follower action.

A typical log entry for this bugs contains something like this:

```
task encountered irrecoverable failure: org.elasticsearch.cluster.block.ClusterBlockException: index [ ... ] blocked by: [FORBIDDEN/4/index closed];
```

### Mitigation

A: Restart the transform. This can be automated by monitoring `_stats` and restarting the transform using `_stop?force=true` followed by `_start`.

B: Don't use the ILM unfollow action until a fix is available.

C: **Unreleased**: Starting with 8.5 set the transform to `unattended` mode via `settings`, this will let transform retry even for this failure class

### Solution

If the source of a transform is configured with a wildcard, transform should not treat an index closed exception as an irrecoverable failure.

### Backport

The fix needs to be backported to the `7.17` series.
x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/TransformFailureHandler.java
* @param settingsConfig The settings
     */
    void handleIndexerFailure(Exception e, SettingsConfig settingsConfig) {
        
        logger.debug(() -> "[" + transformId + "] transform encountered an exception: ", e);
        Throwable unwrappedException = ExceptionsHelper.findSearchExceptionRootCause(e);
        boolean unattended = Boolean.TRUE.equals(settingsConfig.getUnattended());
        if (unwrappedException instanceof CircuitBreakingException circuitBreakingException) {
            handleCircuitBreakingException(circuitBreakingException, unattended);
        } else if (unwrappedException instanceof ScriptException scriptException) {
            handleScriptException(scriptException, unattended);
        } else if (unwrappedException instanceof BulkIndexingException bulkIndexingException) {
            handleBulkIndexingException(bulkIndexingException, unattended, getNumFailureRetries(settingsConfig));
        } else if (unwrappedException instanceof ElasticsearchException elasticsearchException) {
            handleElasticsearchException(elasticsearchException, unattended, getNumFailureRetries(settingsConfig));
        } else if (unwrappedException instanceof IllegalArgumentException illegalArgumentException) {
            handleIllegalArgumentException(illegalArgumentException, unattended);
        } else {
            retry(
                unwrappedException,
                ExceptionRootCauseFinder.getDetailedMessage(unwrappedException),
                unattended,
                getNumFailureRetries(settingsConfig)
            );
        }
    }
    /**
     * Handle failures persisting internal state
     *
     * @param e the exception caught