Pass argument to view for pager limit
Try this out :

use Drupal\views\ViewExecutable;

/**
 * Implements hook_views_pre_build().
 */
function customModule_views_pre_build(ViewExecutable $view) {
  if ($view-&gt;id() == 'your_view_id') {
   //- Set the new limit here // 3
   $view-&gt;setItemsPerPage(3);
  }
}