RAD, 51 46 39 bytes
{+/(⍵∘+¨(⊖,⊢)(⊢,-)(⍳2)(1¯2))∊,W}¨¨W←⍳⍵⍵
##How?
How?
Counts the number of valid knight moves for each square by seeing which knight moves would land on the board:
{+/(⍵∘+¨(⊖,⊢)(⊢,-)(⍳2)(1¯2))∊,W}¨¨W←⍳⍵⍵
+/ - The number of ...
∊,W - ... in-bounds ...
(⊖,⊢)(⊢,-)(⍳2)(1¯2) - ... knight movements ...
(⍵∘+¨ ) - ... from ...
{ }¨¨W←⍳⍵⍵ - ... each square