How can I include an OnPlatform in a style resource?

Define every property as OnPlatform

<OnPlatform x:Key="MyFontSize" x:TypeArguments="x:Double" iOS="14" Android="14" WinPhone="14" />

and refer it in yout button style like

<Style x:Key="MyButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="FontSize" Value="{StaticResource MyFontSize}" />
</Style>

With the new Xamarin OnPlatform specification is possible to define the platform styles directly in the style tag:

<Style x:Key="buttonStyle" TargetType="Button">
  <Setter Property="FontSize">
    <OnPlatform x:TypeArguments="x:Double">
      <On Platform="Android">40</On>
        <On Platform="iOS">10</On>
     </OnPlatform>
   </Setter>
</Style>