for groups 1 2 3 4 5 6 7 8/0 its quite easy
group one has only one electron in its outer shell thus the valence electron on grp 1 will be 1 and so on eg:grp 2 . 2 electrons in outer shell . then no of valence electron=2 ./for transition metals I recommend you ask your tr because he/she will be able to explain properly but idk if tge pic zbove helps but still