### Elasticsearch Version

ALL

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

Darwin

### Problem Description

The `GET _ilm/policy` API could return many records (for clusters that have
many ILM policies). 
The API runs on the `transport_worker` thread so this can cause master instability
issues ( https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportGetLifecycleAction.java#L58 ).

This proposes moving the API on the `MANAGEMENT` thread pool and making
the API cancellable.

### Steps to Reproduce

Have thousands of ILM policies.
Repeatedly issue `GET _ilm/policy`

### Logs (if relevant)

_No response_
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportGetLifecycleAction.java
listener.onFailure(
                    new ResourceNotFoundException("Lifecycle policy not found: {}", Arrays.toString(request.getPolicyNames()))
                );
            }
        } else {
            List<String> names;
            if (request.getPolicyNames().length == 0) {
                names = List.of("*");
            } else {
                names = Arrays.asList(request.getPolicyNames());
            }
            if (names.size() > 1 && names.stream().filter(Regex::isSimpleMatchPattern).count() > 0) {
                throw new IllegalArgumentException(
                    "wildcard only supports a single value, please use comma-separated values or a single wildcard value"
                );
            }
            Map<String, LifecyclePolicyResponseItem> policyResponseItemMap = new LinkedHashMap<>();
            for (String name : names) {
                if (Regex.isSimpleMatchPattern(name)) {
                    for (Map.Entry<String, LifecyclePolicyMetadata> entry : metadata.getPolicyMetadatas().entrySet()) {
                        LifecyclePolicyMetadata policyMetadata = entry.getValue();
                        if (Regex.simpleMatch(name, entry.getKey())) {
                            policyResponseItemMap.put(
                                entry.getKey(),
                                new LifecyclePolicyResponseItem(
                                    policyMetadata.getPolicy(),
                                    policyMetadata.getVersion(),
                                    policyMetadata.getModifiedDateString(),
                                    LifecyclePolicyUtils.calculateUsage(indexNameExpressionResolver, state, policyMetadata.getName())
                                )