in this article, I'll show you how to force template twig for your form element using $info['template']
/**
* @param $variables
* @param $hook
* @param $info
*/
function mytheme_preprocess_form_element(&$variables, $hook, &$info)
{
if (isset($variables['element']['#id'])) {
// $id = $variables['element']['#id'];
// $info['template'] = str_replace('_', '-', $hook) . '--' . $id;
$info['template'] = 'form-element--edit-keys';
}
}
and then you should create form-element--edit-keys.html.twig
file in your theme