In criminal proceedings, a finding by a court that as a result of mental illness, defect, or disability, a defendant is incapable of understanding the nature of the charges and proceedings against him or her, of consulting with an attorney, and of aiding in his or her own defense.