### Elasticsearch Version

main

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

MacOS

### Problem Description

When there are 2 or more concurrent `_update` requests issued, one of them may fail with `ResourceAlreadyExistsException` exception which is misleading.


### Steps to Reproduce

1. Spawn a number of `_update` requests at the same time
2. Look at the results of these requests
3. Observe `ResourceAlreadyExistsException` being thrown in the case of conflict

### Logs (if relevant)

_No response_
x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java
.query(QueryBuilders.termQuery(TransformField.ID.getPreferredName(), transformId))
                    .trackTotalHitsUpTo(1)
            );
        executeAsyncWithOrigin(client, TRANSFORM_ORIGIN, SearchAction.INSTANCE, searchRequest, ActionListener.wrap(searchResponse -> {
            if (searchResponse.getHits().getTotalHits().value == 0) {
                listener.onFailure(
                    new ResourceNotFoundException(TransformMessages.getMessage(TransformMessages.REST_UNKNOWN_TRANSFORM, transformId))
                );
                return;
            }
            QueryBuilder dbqQuery = QueryBuilders.constantScoreQuery(
                QueryBuilders.boolQuery()
                    
                    .filter(QueryBuilders.termQuery(TransformField.ID.getPreferredName(), transformId))
                    
                    .mustNot(QueryBuilders.termQuery("_id", TransformConfig.documentId(transformId)))
            );
            DeleteByQueryRequest dbqRequest = createDeleteByQueryRequest().indices(
                TransformInternalIndexConstants.INDEX_NAME_PATTERN,
                TransformInternalIndexConstants.INDEX_NAME_PATTERN_DEPRECATED
            ).setQuery(dbqQuery).setRefresh(true);
            executeAsyncWithOrigin(client, TRANSFORM_ORIGIN, DeleteByQueryAction.INSTANCE, dbqRequest, deleteListener);
        }, deleteListener::onFailure));
    }
    @Override
    public void deleteTransform(String transformId, ActionListener<Boolean> listener) {
        DeleteByQueryRequest request = createDeleteByQueryRequest();
        request.indices(TransformInternalIndexConstants.INDEX_NAME_PATTERN, TransformInternalIndexConstants.INDEX_NAME_PATTERN_DEPRECATED);
        QueryBuilder query = QueryBuilders.termQuery(TransformField.ID.getPreferredName(), transformId);