Let us assume that K is +1 and O is -2 and then we calculate the oxidation state of sulfur.
We know that, the sum of the oxidation numbers must be zero for a compound. Now evaluating it, we get
K2S2O8
2(+1) + 2x + 8(-2) = 0
2x = 14
x = +7 .... but, Sulfur doesn't exhibit an oxidation state of +7.
This is commonly called sodium persulfate and two of the oxygen atoms, like the peroxide, are in the -1 oxidation state
Now, For simplicity we will write the formula as
K2S2(O2)O6
2(+1) + 2x + 2(-1) + 6(-2)
x = +6 .... which is a viable oxidation state for Sulfur (S)