### 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/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */
package org.elasticsearch.xpack.core.ilm.action;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.cluster.metadata.ItemUsage;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xpack.core.ilm.LifecyclePolicy;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
public class GetLifecycleAction extends ActionType<GetLifecycleAction.Response> {