Local periods of strings
Java 8, 167 154 152 bytes

s-&gt;{int l=s.length,r[]=new int[l],i=0,n,k;for(;i&lt;l;r[i++]=n)n:for(n=0;;){for(k=++n;k--&gt;0;)if(i+k&lt;l&amp;i+k&gt;=n&amp;&amp;s[i+k]!=s[i-n+k])continue n;break;}return r;}

-2 bytes thanks to @ceilingcat.
Try it online.
Explanation:
s-&gt;{                          // Method with char-array parameter and int-array return-type
  int l=s.length,             //  Length of the input-array
      r[]=new int[l],         //  Result-array of the same size 
      i=0,n,k;                //  Integers `i`, `n`, and `k` as defined in the challenge
  for(;i&lt;l;                   //  Loop `i` in the range [0, `l`):
      r[i++]=n)               //    After every iteration: Add `n` to the array
    n:for(n=0;;){             //   Inner loop `n` from 0 upwards indefinitely
      for(k=++n;k--&gt;0;)       //    Inner loop `k` in the range [`n`, 0]:
                              //    (by first increasing `n` by 1 with `++n`)
        if(i+k&lt;l&amp;i+k&gt;=n)      //     If `i+k` and `i-n+k` are both within bounds,
           &amp;&amp;s[i+k]!=s[i-n+k])//     and if `s[i+k]` is not equal to `s[i-n+k]`:
          continue n;         //      Continue loop `n`
                              //    If we haven't encountered the `continue n` in loop `k`:
      break;}                 //     Break loop `n`
  return r;}                  //  Return the result