Tablesort with EntityQuery
Following some of the information found in Berdirs answer and comments I was able to arrive at a solution.

I formatted my header like so:

            $header = [
                'title'      =&gt; [
                    'data'      =&gt; t('title'),
                    'field'     =&gt; 'title',
                    'specifier' =&gt; 'title',
                ],
                'number'       =&gt; [
                    'data'      =&gt; t('Number'),
                    'field'     =&gt; 'field_number',
                    'specifier' =&gt; 'field_number',
                ],
                'time'       =&gt; [
                    'data'      =&gt; t('Time'),
                    'field'     =&gt; 'field_rank',
                    'specifier' =&gt; 'field_rank',
                ],
            ],


I then performed the EntityQuery like so

            $nids = \Drupal::entityQuery('node')
                -&gt;tableSort($header)
                -&gt;condition('type', 'my_content_type')
                -&gt;condition('status', 1)
                -&gt;pager($items_per_page)
                -&gt;execute();


I formatted my rows like so

                $row = [
                    'data' =&gt; [
                        $node-&gt;title-&gt;value,
                        $node-&gt;field_number-&gt;value,
                        $node-&gt;field_rank-&gt;value,
                ];


After that generating the table was easy

            $render = [
                'table'           =&gt; [
                    '#prefix'        =&gt; '&lt;h1&gt;Entries&lt;/h1&gt;',
                    '#theme'         =&gt; 'table',
                    '#attributes'    =&gt; [
                        'data-striping' =&gt; 0
                    ],
                    '#header' =&gt; $header,
                    '#rows'   =&gt; $rows,
                ],
            ];


The important parts I was missing is the proper format for $header. And using ->tableSort($header) instead of                 ->extend('Drupal\Core\Database\Query\TableSortExtender')
                ->orderByHeader($header) in my entityQuery