How can I configure Yii2 code generator to use kartik widgets (or any other custom widgets) by default?
You need to add the template for the corresponding model. See here: https://github.com/schmunk42/yii2-giiant/blob/master/docs/30-using-providers.md