How to add the MAGE_INDEXER_THREADS_COUNT environment variable to env.php?

You can try adding like 'MAGE_INDEXER_THREADS_COUNT'=>3 then the env.php will look something like following

return [
    'backend' => [
        'frontName' => 'magento226administrator'
    ],
    'crypt' => [
        'key' => '45625508600206a4c2d2f2bf406b23fb'
    ],
    'db' => [
        'table_prefix' => '',
        'connection' => [
            'default' => [
                'host' => 'localhost',
                'dbname' => 'localmagento226',
                'username' => 'magento226',
                'password' => 'magento226db',
                'active' => '1'
            ]
        ]
    ],
    'resource' => [
        'default_setup' => [
            'connection' => 'default'
        ]
    ],
    'x-frame-options' => 'SAMEORIGIN',
    'MAGE_MODE' => 'developer',
    'session' => [
        'save' => 'files'
    ],
    'cache_types' => [
        'config' => 1,
        'layout' => 1,
        'block_html' => 1,
        'collections' => 1,
        'reflection' => 1,
        'db_ddl' => 1,
        'eav' => 1,
        'customer_notification' => 1,
        'config_integration' => 1,
        'config_integration_api' => 1,
        'full_page' => 1,
        'config_webservice' => 1,
        'translate' => 1
    ],
    'install' => [
        'date' => 'Wed, 19 Sep 2018 05:55:55 +0000'
    ],
    'MAGE_INDEXER_THREADS_COUNT'=>3
];

Works if you insert below 'MAGE_MODE' with:

'x-frame-options' => 'SAMEORGIN',
'MAGE_MODE' => 'production',
'MAGE_INDEXER_THREADS_COUNT' => '3',
'session' => [
    'save' => 'memcache',
    'save_path' => 'tcp://memcache:11211'
],