Pass values to twig file from #theme options
You need to add it to your $build render object. Here's a piece of sample code, in this case from a Block plugin with a form on it, similar to yours:
...
in my BlockPlugin
..



public function build() {
    // getConfiguration returns the values from the form I have and save to a config object.
    $source = $this-&gt;getConfiguration()['source'];
    $access_token = $this-&gt;getConfiguration()['access_token'];

    $build = [
      '#theme' =&gt; 'my_fancy_search_widget',
      '#source_data' =&gt; $source,
      '#access_token' =&gt; $access_token,
    ];
    return $build;
  }


...
in my .module file:
...


/**
 * Implements hook_theme().
 */
function my_module_theme($existing, $type, $theme, $path) {
  return [
  'my_fancy_search_widget' =&gt; [
      'template' =&gt; 'main-search',
      'variables' =&gt; [
        'source_data' =&gt; NULL,
        'access_token' =&gt; NULL,
      ],
  ];
}



in my twig template I can print these vars with {{ source_data }} and {{ access_token }}