Hi,
sec. 3(f) Hindu Marriage act says what is a sapinda relationship and the marriage between sapinda is void.
The act specifies that if customs permits to sapindas to marry .in sec.5 (v)
sec.5 .V.The parties are not sapindas of each other, unless the custom or usage governing each of them permits of a marriage between the two;
If your custom permits you to marry your marriage is legal, for example in some part of Andrapradesh, Tamilnadu and in among hindus in Kerala sapinda marriage is accepted as a customary right.
So if your local caste customs allows a marriage within the cousins it is legal and not void.
However whatever the legality of the relationship , there was a marriage an d i t is registered , so it is necessary to get a court decree of divorce. Therefore it is necessary to file for divorce on mutual or individually under any other ground .