I'm seeing quite a few of these in prod:

```
java.lang.NullPointerException: Cannot invoke "org.elasticsearch.xpack.core.transform.transforms.TransformState.getTaskState()" because "transformState" is null
    at org.elasticsearch.xpack.transform.TransformUsageTransportAction.masterOperation(TransformUsageTransportAction.java:106) ~[?:?]
    at org.elasticsearch.xpack.transform.TransformUsageTransportAction.masterOperation(TransformUsageTransportAction.java:55) ~[?:?]
    at org.elasticsearch.action.support.master.TransportMasterNodeAction.executeMasterOperation(TransportMasterNodeAction.java:124) ~[elasticsearch-8.9.0.jar:?]
    at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.lambda$doStart$3(TransportMasterNodeAction.java:235) ~[elasticsearch-8.9.0.jar:?]
    at org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72) ~[elasticsearch-8.9.0.jar:?]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983) ~[elasticsearch-8.9.0.jar:?]
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) ~[elasticsearch-8.9.0.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.lang.Thread.run(Thread.java:1623) ~[?:?]
```

`org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask#getState` is declared `@Nullable` but this case is not handled properly by the usage action.
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsStatsAction.java
SortBuilders.fieldSort(Fields.TIMESTAMP.getPreferredName())
                    .order(SortOrder.DESC)
                    
                    .unmappedType("long")
            );
        return searchRequest;
    }
    private static void parseHit(SearchHit hit, String configId, RetrievedStatsHolder retrievedStatsHolder) {
        String hitId = hit.getId();
        if (StoredProgress.documentId(configId).equals(hitId)) {
            retrievedStatsHolder.progress = MlParserUtils.parse(hit, StoredProgress.PARSER);
        } else if (DataCounts.documentId(configId).equals(hitId)) {
            retrievedStatsHolder.dataCounts = MlParserUtils.parse(hit, DataCounts.LENIENT_PARSER);
        } else if (hitId.startsWith(MemoryUsage.documentIdPrefix(configId))) {
            retrievedStatsHolder.memoryUsage = MlParserUtils.parse(hit, MemoryUsage.LENIENT_PARSER);
        } else if (hitId.startsWith(OutlierDetectionStats.documentIdPrefix(configId))) {
            retrievedStatsHolder.analysisStats = MlParserUtils.parse(hit, OutlierDetectionStats.LENIENT_PARSER);
        } else if (hitId.startsWith(ClassificationStats.documentIdPrefix(configId))) {
            retrievedStatsHolder.analysisStats = MlParserUtils.parse(hit, ClassificationStats.LENIENT_PARSER);
        } else if (hitId.startsWith(RegressionStats.documentIdPrefix(configId))) {
            retrievedStatsHolder.analysisStats = MlParserUtils.parse(hit, RegressionStats.LENIENT_PARSER);
        } else {
            throw ExceptionsHelper.serverError("unexpected doc id [" + hitId + "]");
        }
    }
    private GetDataFrameAnalyticsStatsAction.Response.Stats buildStats(
        String concreteAnalyticsId,
        List<PhaseProgress> progress,
        DataCounts dataCounts,
        MemoryUsage memoryUsage,