A preview call can be quite expensive and cause timeout in a cluster. As a short term fix we identified 2 (hopefully) small fixes:

- make the call cancellable, the main issue here seems to be that preview calls search without using a parent task id(see this fix for data feeds: https://github.com/elastic/elasticsearch/pull/88142/files#diff-aba58244cb8f9dfa3ac3b6efeb02259e3d5956576f56c1ff5e243dd2aac27381)
- pass the timeout parameter of the preview call to the search call, currently a timeout can be specified, but is ignored for the inner search call, which is executed with no timeout (see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html#search-search-api-query-params).

Both changes are bugs and shall be relatively simple to implement and considered for backport to the 7.17 branch.

@przemekwitek can you have a look at this?

related: #88010
x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPreviewTransformAction.java
@Override
    public List<Route> routes() {
        return List.of(
            new Route(GET, TransformField.REST_BASE_PATH_TRANSFORMS + "_preview"),
            new Route(GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_preview"),
            new Route(POST, TransformField.REST_BASE_PATH_TRANSFORMS + "_preview"),
            new Route(POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_preview")
        );
    }
    @Override
    public String getName() {
        return "transform_preview_transform_action";
    }
    @Override
    protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
        String transformId = restRequest.param(TransformField.ID.getPreferredName());
        if (Strings.isNullOrEmpty(transformId) && restRequest.hasContentOrSourceParam() == false) {
            throw ExceptionsHelper.badRequestException(
                "Please provide a transform [{}] or the config object",
                TransformField.ID.getPreferredName()
            );
        }
        if (Strings.isNullOrEmpty(transformId) == false && restRequest.hasContentOrSourceParam()) {
            throw ExceptionsHelper.badRequestException(
                "Please provide either a transform [{}] or the config object but not both",
                TransformField.ID.getPreferredName()
            );
        }
        TimeValue timeout = restRequest.paramAsTime(TransformField.TIMEOUT.getPreferredName(), AcknowledgedRequest.DEFAULT_ACK_TIMEOUT);
        SetOnce<PreviewTransformAction.Request> previewRequestHolder = new SetOnce<>();