Solved with the following code:
<div class="lwa lwa-default"><?php //class must be here, and if this is a template, class name should be that of template directory ?>
<form class="lwa-form" action="<?php echo esc_attr(LoginWithAjax::$url_login); ?>" method="post">
<span class="lwa-status"></span>
<table>
<tr class="lwa-submit">
<td class="lwa-submit-links">
<?php if ( get_option('users_can_register') ) : ?>
<br />
<a href="<?php echo esc_attr(LoginWithAjax::$url_register); ?>" class="lwa-links-register lwa-links-modal"><?php esc_html_e('Register','login-with-ajax') ?></a>
<?php endif; ?>
</td>
</tr>
</table>
</form>
<?php if( get_option('users_can_register') ): ?>
<div class="lwa-register lwa-register-default lwa-modal" style="display:none;">
<h4><?php esc_html_e('Register For This Site','login-with-ajax') ?></h4>
<p><em class="lwa-register-tip"><?php esc_html_e('A password will be e-mailed to you.','login-with-ajax') ?></em></p>
<form class="lwa-register-form" action="<?php echo esc_attr(LoginWithAjax::$url_register); ?>" method="post">
<span class="lwa-status"></span>
<p class="lwa-username">
<label><?php esc_html_e('Username','login-with-ajax') ?><br />
<input type="text" name="user_login" id="user_login" class="input" size="20" tabindex="10" /></label>
</p>
<p class="lwa-email">
<label><?php esc_html_e('E-mail','login-with-ajax') ?><br />
<input type="text" name="user_email" id="user_email" class="input" size="25" tabindex="20" /></label>
</p>
<?php do_action('register_form'); ?>
<?php do_action('lwa_register_form'); ?>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register', 'login-with-ajax'); ?>" tabindex="100" />
</p>
<input type="hidden" name="login-with-ajax" value="register" />
</form>
</div>
<?php endif; ?>
</div>