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
GetDataFrameAnalyticsStatsAction.Response runningTasksResponse,
        TaskId parentTaskId,
        ActionListener<GetDataFrameAnalyticsStatsAction.Response> listener
    ) {
        List<DataFrameAnalyticsConfig> stoppedConfigs = determineStoppedConfigs(configs, runningTasksResponse.getResponse().results());
        if (stoppedConfigs.isEmpty()) {
            listener.onResponse(runningTasksResponse);
            return;
        }
        AtomicInteger counter = new AtomicInteger(stoppedConfigs.size());
        AtomicArray<Stats> jobStats = new AtomicArray<>(stoppedConfigs.size());
        AtomicReference<Exception> searchException = new AtomicReference<>();
        for (int i = 0; i < stoppedConfigs.size(); i++) {
            final int slot = i;
            DataFrameAnalyticsConfig config = stoppedConfigs.get(i);
            searchStats(config, parentTaskId, ActionListener.wrap(stats -> {
                jobStats.set(slot, stats);
                if (counter.decrementAndGet() == 0) {
                    if (searchException.get() != null) {
                        listener.onFailure(searchException.get());
                        return;
                    }
                    List<Stats> allTasksStats = new ArrayList<>(runningTasksResponse.getResponse().results());
                    allTasksStats.addAll(jobStats.asList());
                    allTasksStats.sort(Comparator.comparing(Stats::getId));
                    listener.onResponse(
                        new GetDataFrameAnalyticsStatsAction.Response(
                            new QueryPage<>(allTasksStats, allTasksStats.size(), GetDataFrameAnalyticsAction.Response.RESULTS_FIELD)
                        )
                    );