This is made by a neurologist, often one specializing in movement disorders based on examination and history about your symptoms. This might include investigations such as brain scan, blood and/or urine tests in some cases. It is not uncommon for mild dystonia to go undiagnosed or misdiagnosed for a while.
Please visit the following sites for more information:
Dystonia Fact Sheet (NINDS)