Legal regulation as a factor of state stability and society’s development